diff options
| author | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-26 20:12:46 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi92@disroot.org> | 2025-10-26 20:12:46 +0100 |
| commit | 953210bd1930e1734f1acde86eadd7a1997bb7c3 (patch) | |
| tree | a857a321f099051a98ea81966daee35f66373c17 | |
| parent | de7f4b2ffcd92dfeada9235ce857b801a4851da7 (diff) | |
form.c: Fix leak on invalid formv0.5.1
When one or more entries have been appended to a struct form instance,
but then an error occurs, those valid entries must be deallocated, too.
| -rw-r--r-- | form.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -161,7 +161,6 @@ int form_foreach(const struct form *const f, const form_iter it, return 0; } - int form_alloc(const char *data, struct form **const out) { int ret = -1; @@ -188,6 +187,6 @@ int form_alloc(const char *data, struct form **const out) return 0; failure: - free(f); + form_free(f); return ret; } |
