]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add missing MEM() guards to fr_value_box_alloc_null() calls (#4619)
authorJames Jones <jejones3141@gmail.com>
Wed, 20 Jul 2022 15:34:09 +0000 (10:34 -0500)
committerGitHub <noreply@github.com>
Wed, 20 Jul 2022 15:34:09 +0000 (11:34 -0400)
One, in debug_attr_vp(), will silence CID #1507353. The
other is not associated with a coveriy issue, but should
be there. With this change, all fr_value_box_alloc_null()
call returns will either be checked by MEM() or have an
explicit check in the code.

src/lib/unlang/xlat_builtin.c
src/modules/rlm_unbound/rlm_unbound.c

index d677ee3cd61202642da8fc417df684cf9d2a34f0..4150564b2415472ebd9bd92bc710bb947fb52070 100644 (file)
@@ -1003,7 +1003,7 @@ static void debug_attr_vp(request_t *request, fr_pair_t *vp, tmpl_t const *vpt)
                REXDENT();
                RIDEBUG2("}");
                break;
-               
+
        default:
                if (vpt) {
                        RIDEBUG2("&%s.%s = %pV",
@@ -1054,7 +1054,7 @@ static void debug_attr_vp(request_t *request, fr_pair_t *vp, tmpl_t const *vpt)
                        break;
                }
 
-               dst = fr_value_box_alloc_null(vp);
+               MEM(dst = fr_value_box_alloc_null(vp));
                /* We expect some to fail */
                if (fr_value_box_cast(dst, dst, type->value, NULL, &vp->data) < 0) {
                        goto next_type;
index f962d48719af1d2887b15ea5b70e7a3519feb922..3185752ef038d35dc608b10dc5f83ba26bead610 100644 (file)
@@ -217,7 +217,7 @@ static void xlat_unbound_callback(void *mydata, int rcode, void *packet, int pac
                                        REDEBUG("%s - Invalid data returned", ur->t->inst->name);
                                        goto error;
                                }
-                               priority_vb = fr_value_box_alloc_null(ur->out_ctx);
+                               MEM(priority_vb = fr_value_box_alloc_null(ur->out_ctx));
                                if (fr_value_box_from_network(ur->out_ctx, priority_vb, FR_TYPE_UINT16, NULL,
                                                              &dbuff, 2, true) < 0) {
                                        talloc_free(priority_vb);