CLEANUP: Apply ha_free.cocci

Use `ha_free()` where possible.
This commit is contained in:
Tim Duesterhus 2021-11-04 21:03:52 +01:00 committed by Willy Tarreau
parent cc17a6e1d3
commit 025b93e3a2
3 changed files with 4 additions and 8 deletions

View File

@ -39,8 +39,7 @@ int check_action_rules(struct list *rules, struct proxy *px, int *err_code)
err++; err++;
} }
*err_code |= warnif_tcp_http_cond(px, rule->cond); *err_code |= warnif_tcp_http_cond(px, rule->cond);
free(errmsg); ha_free(&errmsg);
errmsg = NULL;
} }
return err; return err;

View File

@ -2380,8 +2380,7 @@ struct server *srv_drop(struct server *srv)
EXTRA_COUNTERS_FREE(srv->extra_counters); EXTRA_COUNTERS_FREE(srv->extra_counters);
free(srv); ha_free(&srv);
srv = NULL;
end: end:
return next; return next;

View File

@ -2506,8 +2506,7 @@ static int cli_parse_set_cafile(char **args, char *payload, struct appctx *appct
appctx->ctx.ssl.new_cafile_entry = NULL; appctx->ctx.ssl.new_cafile_entry = NULL;
appctx->ctx.ssl.old_cafile_entry = NULL; appctx->ctx.ssl.old_cafile_entry = NULL;
free(appctx->ctx.ssl.path); ha_free(&appctx->ctx.ssl.path);
appctx->ctx.ssl.path = NULL;
HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock); HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
return cli_dynerr(appctx, memprintf(&err, "%sCan't update %s!\n", err ? err : "", args[3])); return cli_dynerr(appctx, memprintf(&err, "%sCan't update %s!\n", err ? err : "", args[3]));
@ -3225,8 +3224,7 @@ static int cli_parse_set_crlfile(char **args, char *payload, struct appctx *appc
appctx->ctx.ssl.new_crlfile_entry = NULL; appctx->ctx.ssl.new_crlfile_entry = NULL;
appctx->ctx.ssl.old_crlfile_entry = NULL; appctx->ctx.ssl.old_crlfile_entry = NULL;
free(appctx->ctx.ssl.path); ha_free(&appctx->ctx.ssl.path);
appctx->ctx.ssl.path = NULL;
HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock); HA_SPIN_UNLOCK(CKCH_LOCK, &ckch_lock);
return cli_dynerr(appctx, memprintf(&err, "%sCan't update %s!\n", err ? err : "", args[3])); return cli_dynerr(appctx, memprintf(&err, "%sCan't update %s!\n", err ? err : "", args[3]));