aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 0e1935670..10aafd81c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1892,7 +1892,11 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
/* we already have a string, we append this one
with a separating &-letter */
char *oldpost=config->postfields;
- config->postfields=aprintf("%s&%s", oldpost, postdata);
+ size_t newlen = strlen(oldpost) + strlen(postdata) + 2;
+ config->postfields=malloc(newlen);
+ if(!config->postfields)
+ return PARAM_NO_MEM;
+ snprintf(config->postfields, newlen, "%s&%s", oldpost, postdata);
free(oldpost);
free(postdata);
}