diff options
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -208,23 +208,16 @@ static int get_forms(const struct http_payload *const pl, { int ret = -1; const struct http_post *const p = &pl->u.post; - const char *const ref = p->data; - char *dup = NULL; struct form *f = NULL; - if (!ref) + if (!p->data) { fprintf(stderr, "%s: expected non-NULL buffer\n", __func__); ret = 1; goto end; } - else if (!(dup = strndup(ref, p->n))) - { - fprintf(stderr, "%s: strndup(3): %s\n", __func__, strerror(errno)); - goto end; - } - const char *s = dup; + const char *s = p->data; *outn = 0; @@ -241,8 +234,6 @@ static int get_forms(const struct http_payload *const pl, ret = 0; end: - free(dup); - if (ret) forms_free(f, *outn); |
