* use calloc instead of malloc

* set *argc = 0 if mem for the *argv cannot be allocated.


SVN revision: 23357
This commit is contained in:
sndev 2006-06-10 16:54:36 +00:00 committed by sndev
parent 3a0454a50b
commit b877a0e74a
1 changed files with 6 additions and 2 deletions

View File

@ -752,8 +752,12 @@ ecore_x_icccm_command_get(Ecore_X_Window win, int *argc, char ***argv)
if (argc) *argc = c;
if (argv)
{
(*argv) = malloc(c);
if (!*argv) return;
(*argv) = calloc(c, sizeof(char *));
if (!*argv)
{
*argc = 0;
return;
}
for (i = 0; i < c; i++)
(*argv)[i] = strdup(v[i]);
}