diff --git a/src/pattern.c b/src/pattern.c index 135c0bcede89..93a956586b65 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -1793,8 +1793,10 @@ int pat_ref_set(struct pat_ref *ref, const char *key, const char *value, char ** elt = ebmb_entry(node, struct pat_ref_elt, node); node = ebmb_next_dup(node); if (!pat_ref_set_elt(ref, elt, value, &tmp_err)) { - memprintf(err, "%s, %s", err && *err ? *err : "", tmp_err); - ha_free(&tmp_err); + if (err) + *err = tmp_err; + else + ha_free(&tmp_err); return 0; } found = 1;