]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
to_cast is not always talloced
authorNick Porter <nick@portercomputing.co.uk>
Mon, 4 Sep 2023 15:02:18 +0000 (16:02 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Mon, 4 Sep 2023 15:02:18 +0000 (16:02 +0100)
src/lib/redis/redis.c

index 99ad53042dd047c82f05b7d4ee78bd1000a163b3..c19210eaec7aee6cb0e75120d337fecdd02091e0 100644 (file)
@@ -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;