Commit cf6ca755 authored by Stefan Behnel's avatar Stefan Behnel

free()-ing a NULL pointer should be fine

parent a8408070
...@@ -163,16 +163,14 @@ int ...@@ -163,16 +163,14 @@ int
return __Pyx_main(0, NULL); return __Pyx_main(0, NULL);
} }
else { else {
wchar_t **argv_copy = (wchar_t **)malloc(sizeof(wchar_t*)*argc);
/* We need a second copies, as Python might modify the first one. */
wchar_t **argv_copy2 = (wchar_t **)malloc(sizeof(wchar_t*)*argc);
int i, res; int i, res;
char *oldloc; char *oldloc;
wchar_t **argv_copy = (wchar_t **)malloc(sizeof(wchar_t*)*argc);
/* We need a second copy, as Python might modify the first one. */
wchar_t **argv_copy2 = (wchar_t **)malloc(sizeof(wchar_t*)*argc);
if (!argv_copy || !argv_copy2) { if (!argv_copy || !argv_copy2) {
fprintf(stderr, "out of memory\\n"); fprintf(stderr, "out of memory\\n");
if (argv_copy)
free(argv_copy); free(argv_copy);
if (argv_copy2)
free(argv_copy2); free(argv_copy2);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment