cmd = (char *)malloc(strlen(set_color) - 2 + strlen(color) + 1);
cmd = (char *)malloc(strlen(set_color) + strlen(color) + 1);
void solid_gnome(char *color) {	char get_color[] = "gconftool-2 --get "	    "/desktop/gnome/background/primary_color";	char set_color[] = "gconftool-2 --set "	    "/desktop/gnome/background/primary_color --type string '%s'";	char get_option[] = "gconftool-2 --get "	    "/desktop/gnome/background/picture_options";	char set_option[] = "gconftool-2 --set "	    "/desktop/gnome/background/picture_options --type string '%s'";	static char *orig_color = NULL;	static char *orig_option = NULL;	char *cmd;		if (! color) {		if (! orig_color) {			orig_color = strdup("#FFFFFF");		}		if (! orig_option) {			orig_option = strdup("stretched");		}		if (strstr(orig_color, "'") != NULL)  {			rfbLog("bad color: %s\n", orig_color);			return;		}		if (strstr(orig_option, "'") != NULL)  {			rfbLog("bad option: %s\n", orig_option);			return;		}		cmd = (char *)malloc(strlen(set_option) - 2 +		    strlen(orig_option) + 1);		sprintf(cmd, set_option, orig_option);		do_cmd(cmd);		free(cmd);		cmd = (char *)malloc(strlen(set_color) - 2 +		    strlen(orig_color) + 1);		sprintf(cmd, set_color, orig_color);		do_cmd(cmd);		free(cmd);		return;	}	if (! orig_color) {		char *q;		orig_color = strdup(cmd_output(get_color));		if (*orig_color == '\0') {			orig_color = strdup("#FFFFFF");		}		if ((q = strchr(orig_color, '\n')) != NULL) {			*q = '\0';		}	}	if (! orig_option) {		char *q;		orig_option = strdup(cmd_output(get_option));		if (*orig_option == '\0') {			orig_option = strdup("stretched");		}		if ((q = strchr(orig_option, '\n')) != NULL) {			*q = '\0';		}	}	if (strstr(color, "'") != NULL)  {		rfbLog("bad color: %s\n", color);		return;	}	cmd = (char *)malloc(strlen(set_color) - 2 + strlen(color) + 1);	sprintf(cmd, set_color, color);	do_cmd(cmd);	free(cmd);	cmd = (char *)malloc(strlen(set_option) - 2 + strlen("none") + 1);	sprintf(cmd, set_option, "none");	do_cmd(cmd);	free(cmd);}