Commit 9e1a1123 authored by Nils Larsch's avatar Nils Larsch
Browse files

initialize newly allocated data

PR: 1145
parent 4e28f132
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -374,10 +374,17 @@ int chopup_args(ARGS *arg, char *buf, int *argc, char **argv[])
		/* The start of something good :-) */
		if (num >= arg->count)
			{
			arg->count+=20;
			arg->data=(char **)OPENSSL_realloc(arg->data,
				sizeof(char *)*arg->count);
			if (argc == 0) return(0);
			char **tmp_p;
			int tlen = arg->count + 20;
			tmp_p = (char **)OPENSSL_realloc(arg->data,
				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;