mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-05-02 11:41:07 +02:00
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:
parent
a4f27d96c6
commit
7465b5ec38
@ -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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user