]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix memory leak and deadlock on error path in cache module
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 21 Feb 2026 07:04:26 +0000 (00:04 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Sat, 21 Feb 2026 07:04:26 +0000 (00:04 -0700)
src/modules/rlm_cache/rlm_cache.c

index 581102dd54a6dcfe4c946c76ed9c96dd4ec5be12..98535fbbf7c2259956196e01366cad486d050719 100644 (file)
@@ -958,6 +958,9 @@ xlat_action_t cache_xlat(TALLOC_CTX *ctx, fr_dcursor_t *out,
                if (unlikely(fr_value_box_copy(vb, vb, tmpl_value(map->rhs)) < 0)) {
                        RPEDEBUG("Failed copying value from cache entry");
                        talloc_free(vb);
+                       talloc_free(target);
+                       cache_free(inst, &c);
+                       cache_release(inst, request, &handle);
                        return XLAT_ACTION_FAIL;
                }
                fr_dcursor_append(out, vb);