mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-15 21:59:41 -04:00
CLEANUP: cli: ensure we can never double-free error messages
The release handler used to be called twice for some time and just by pure luck we never ended up double-freeing the data there. Add a NULL to ensure this can never happen should a future change permit this situation again.
This commit is contained in:
parent
8c1ad716df
commit
6457d0fac3
1 changed files with 2 additions and 0 deletions
|
|
@ -6155,9 +6155,11 @@ static void cli_release_handler(struct appctx *appctx)
|
|||
}
|
||||
else if (appctx->st0 == STAT_CLI_PRINT_FREE) {
|
||||
free(appctx->ctx.cli.err);
|
||||
appctx->ctx.cli.err = NULL;
|
||||
}
|
||||
else if (appctx->st0 == STAT_CLI_O_MLOOK) {
|
||||
free(appctx->ctx.map.chunk.str);
|
||||
appctx->ctx.map.chunk.str = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue