Bail early on error.

SVN revision: 26041
This commit is contained in:
sebastid 2006-09-23 08:29:46 +00:00 committed by sebastid
parent 4459beb979
commit 7540fa30ce
1 changed files with 108 additions and 113 deletions

View File

@ -790,18 +790,16 @@ ecore_desktop_get_command(Ecore_Desktop * desktop, Ecore_List * files, int fill)
char *result = NULL, *params = NULL;
if (fill && (desktop->exec_params))
{
params = strdup(desktop->exec_params);
if (params)
{
Ecore_DList *command;
command = ecore_dlist_new();
if (command)
{
char *p, *t, buf[PATH_MAX + 10];
int len = 0;
params = strdup(desktop->exec_params);
if (!params) goto error;
command = ecore_dlist_new();
if (!command) goto error;
ecore_dlist_set_free_cb(command, free);
t = params;
for (p = params; *p; p++)
@ -863,8 +861,7 @@ ecore_desktop_get_command(Ecore_Desktop * desktop, Ecore_List * files, int fill)
case 'i': /* "--icon Icon" field from .desktop file, or empty. */
if (desktop->icon)
{
snprintf(buf, sizeof(buf), "--icon %s",
desktop->icon);
snprintf(buf, sizeof(buf), "--icon %s", desktop->icon);
t = buf;
}
break;
@ -906,15 +903,13 @@ ecore_desktop_get_command(Ecore_Desktop * desktop, Ecore_List * files, int fill)
}
ecore_list_destroy(command);
}
}
}
else if (desktop->exec_params)
params = strdup(desktop->exec_params);
result = ecore_desktop_merge_command(desktop->exec, params);
if (params)
free(params);
error:
if (params) free(params);
return result;
}