From: Alan T. DeKok Date: Wed, 27 Jul 2022 14:36:23 +0000 (-0400) Subject: just use TALLOC_FREE, which sets it to NULL X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=419baead17ae4a9c0e248f302d4c7e8c2d9774ce;p=thirdparty%2Ffreeradius-server.git just use TALLOC_FREE, which sets it to NULL don't check if it's NULL before calling talloc_free(), that function can take NULLs. don't assign NULL to the variable just before exiting the function. It does nothing --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index bc9546f0291..c2c775ba0ef 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -189,10 +189,7 @@ int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, map_t *parent, CONF_PAIR *cp, marker_subject = value; goto marker; } - if (unescaped_value != NULL) { - talloc_free(unescaped_value); - unescaped_value = NULL; - } + TALLOC_FREE(unescaped_value); if (!map->rhs) { cf_log_perr(cp, "Failed parsing RHS"); @@ -233,10 +230,7 @@ int map_afrom_cp(TALLOC_CTX *ctx, map_t **out, map_t *parent, CONF_PAIR *cp, return 0; error: - if (unescaped_value != NULL) { - talloc_free(unescaped_value); - unescaped_value = NULL; - } + talloc_free(unescaped_value); talloc_free(map); return -1; }