From: Nick Porter Date: Mon, 4 Sep 2023 15:02:18 +0000 (+0100) Subject: to_cast is not always talloced X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9e0fa805902520a69060395d86c66528a2822dd7;p=thirdparty%2Ffreeradius-server.git to_cast is not always talloced --- diff --git a/src/lib/redis/redis.c b/src/lib/redis/redis.c index 99ad53042dd..c19210eaec7 100644 --- a/src/lib/redis/redis.c +++ b/src/lib/redis/redis.c @@ -281,7 +281,8 @@ int fr_redis_reply_to_value_box(TALLOC_CTX *ctx, fr_value_box_t *out, redisReply if (shallow) { fr_value_box_bstrndup_shallow(to_cast, NULL, reply->str, reply->len, true); } else { - if (fr_value_box_bstrndup(to_cast, to_cast, NULL, reply->str, reply->len, true) < 0) return -1; + if (fr_value_box_bstrndup(to_cast->talloced ? to_cast : ctx, to_cast, NULL, + reply->str, reply->len, true) < 0) return -1; } break;