initialize newly allocated data
PR: 1145
This commit is contained in:
parent
6835cdf3b4
commit
e80f233749
15
apps/apps.c
15
apps/apps.c
@ -361,10 +361,17 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
|
|||||||
/* The start of something good :-) */
|
/* The start of something good :-) */
|
||||||
if (num >= arg->count)
|
if (num >= arg->count)
|
||||||
{
|
{
|
||||||
arg->count+=20;
|
char **tmp_p;
|
||||||
arg->data=(char **)OPENSSL_realloc(arg->data,
|
int tlen = arg->count + 20;
|
||||||
sizeof(char *)*arg->count);
|
tmp_p = (char **)OPENSSL_realloc(arg->data,
|
||||||
if (argc == 0) return(0);
|
sizeof(char *)*tlen);
|
||||||
|
if (tmp_p == NULL)
|
||||||
|
return 0;
|
||||||
|
arg->data = tmp_p;
|
||||||
|
arg->count = tlen;
|
||||||
|
/* initialize newly allocated data */
|
||||||
|
for (i = num; i < arg->count; i++)
|
||||||
|
arg->data[i] = NULL;
|
||||||
}
|
}
|
||||||
arg->data[num++]=p;
|
arg->data[num++]=p;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user