]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
just use TALLOC_FREE, which sets it to NULL
authorAlan T. DeKok <aland@freeradius.org>
Wed, 27 Jul 2022 14:36:23 +0000 (10:36 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 27 Jul 2022 14:36:23 +0000 (10:36 -0400)
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

src/lib/server/map.c

index bc9546f0291db552b5def220bde63980854b46a9..c2c775ba0efece7f777b669e2e005f535f28244b 100644 (file)
@@ -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;
 }