diff options
author | RichardHitt <rbh00@netcom.com> | 2013-01-10 02:14:02 -0800 |
---|---|---|
committer | RichardHitt <rbh00@netcom.com> | 2013-01-10 02:14:02 -0800 |
commit | bf673072e8457b60a5a8c8d0adf53fa3ccb71ea6 (patch) | |
tree | 4a4d78d292998d449f04237c779d6d90e38b44ec /src/common/util.c | |
parent | efdfa50f1e711e5bdd3ec98a3dedea422b3da362 (diff) | |
parent | 475eb9fcaab1d846a3617f587f22bd77cdeddd5e (diff) |
Merge branch 'master' into pull350
Diffstat (limited to 'src/common/util.c')
-rw-r--r-- | src/common/util.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/common/util.c b/src/common/util.c index 55cb530a..2319f75e 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1319,8 +1319,17 @@ int my_poptParseArgvString(const char * s, int * argcPtr, char *** argvPtr) { if (*argv[argc]) { buf++, argc++; if (argc == argvAlloced) { + char **temp; argvAlloced += POPT_ARGV_ARRAY_GROW_DELTA; - argv = realloc(argv, sizeof(*argv) * argvAlloced); + temp = realloc(argv, sizeof(*argv) * argvAlloced); + if (temp) + argv = temp; + else + { + free(argv); + free(bufStart); + return 1; + } } argv[argc] = buf; } |