From: Jorge Pereira Date: Mon, 13 May 2019 23:26:10 +0000 (-0300) Subject: map_to_vp() Another slow memory leak X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed8afc128d323591ec007b72985d736670bd7705;p=thirdparty%2Ffreeradius-server.git map_to_vp() Another slow memory leak --- diff --git a/src/lib/server/map.c b/src/lib/server/map.c index da7021bd2bc..4c57832dc51 100644 --- a/src/lib/server/map.c +++ b/src/lib/server/map.c @@ -2260,6 +2260,7 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons if (map->lhs->tmpl_da->type == map->rhs->tmpl_value_type) { if (fr_value_box_copy(n, &n->data, &map->rhs->tmpl_value) < 0) { rcode = -1; + talloc_free(n); goto error; } } else { @@ -2267,6 +2268,7 @@ int map_to_vp(TALLOC_CTX *ctx, VALUE_PAIR **out, REQUEST *request, vp_map_t cons &map->rhs->tmpl_value) < 0) { RPEDEBUG("Implicit cast failed"); rcode = -1; + talloc_free(n); goto error; } }