]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
map_to_vp() Another slow memory leak
authorJorge Pereira <jpereiran@gmail.com>
Mon, 13 May 2019 23:26:10 +0000 (20:26 -0300)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 14 May 2019 02:01:53 +0000 (22:01 -0400)
src/lib/server/map.c

index da7021bd2bc43214b58b9a95b3843ba39e25fc61..4c57832dc51028cf1fe12d3c9e74ec39a8f2df34 100644 (file)
@@ -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;
                        }
                }