BUG/MINOR: sample: fix memory leak in smp_resolve_args error paths

Several error paths in smp_resolve_args used 'continue' which skipped
LIST_DELETE and free(cur), leaking the arg_list node. Changed all to
'break' to ensure proper cleanup on all error paths. This is harmless
since when such issues are met, the process refuses to start, so no
backport is really needed.
This commit is contained in:
Willy Tarreau 2026-04-26 23:55:03 +02:00
parent a4f27d96c6
commit 7465b5ec38

View File

@ -1489,7 +1489,7 @@ int smp_resolve_args(struct proxy *p, char **err)
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id, err2);
ha_free(&err2);
cfgerr++;
continue;
break;
}
break;
@ -1499,7 +1499,7 @@ int smp_resolve_args(struct proxy *p, char **err)
*err ? *err : "", cur->file, cur->line,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
continue;
break;
}
/* we support two formats : "bck/srv" and "srv" */
@ -1682,7 +1682,7 @@ int smp_resolve_args(struct proxy *p, char **err)
*err ? *err : "", cur->file, cur->line,
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id);
cfgerr++;
continue;
break;
}
rflags = 0;
@ -1696,7 +1696,7 @@ int smp_resolve_args(struct proxy *p, char **err)
cur->arg_pos + 1, conv_pre, conv_ctx, conv_pos, ctx, cur->kw, where, p->id, err2);
ha_free(&err2);
cfgerr++;
continue;
break;
}
chunk_destroy(&arg->data.str);