]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
return if alloc failed
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 17 Jan 2020 22:50:51 +0000 (22:50 +0000)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Fri, 17 Jan 2020 22:52:18 +0000 (22:52 +0000)
src/lib/util/value.h

index 9fd9b025eabb64e21ecc34cce70617e59aa7e706..8806d25366e49d1d0a55dcdce90e850f541d3efd 100644 (file)
@@ -314,7 +314,7 @@ static inline fr_value_box_t *fr_value_box_alloc(TALLOC_CTX *ctx, fr_type_t type
        fr_value_box_t *value;
 
        value = talloc_zero(ctx, fr_value_box_t);
-       if (!value) return NULL;
+       if (unlikely(!value)) return NULL;
 
        fr_value_box_init(value, type, enumv, tainted);
 
@@ -333,6 +333,8 @@ static inline fr_value_box_t *fr_value_box_alloc_null(TALLOC_CTX *ctx)
        fr_value_box_t *value;
 
        value = talloc_zero(ctx, fr_value_box_t);
+       if (unlikely(!value)) return NULL;
+
        value->type = FR_TYPE_INVALID;
 
        return value;