len = strlen(bg_off) + strlen(user) + 1; cmd = (char *)malloc(len); sprintf(cmd, bg_off, user); dt_cmd(cmd); free(cmd); free(user);
void solid_kde(char *color) {	char set_color[] = "dcop kdesktop KBackgroundIface setColor '%s' 1";	char bg_off[] = "dcop kdesktop KBackgroundIface setBackgroundEnabled 0";	char bg_on[]  = "dcop kdesktop KBackgroundIface setBackgroundEnabled 1";	char *cmd;	if (! color) {		do_cmd(bg_on);		return;	}	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);	do_cmd(bg_off);	free(cmd);}