From: Matthew Newton Date: Fri, 17 Jan 2020 22:50:51 +0000 (+0000) Subject: return if alloc failed X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c831fd6aee5ade46df3bb43f244f1f628f847e95;p=thirdparty%2Ffreeradius-server.git return if alloc failed --- diff --git a/src/lib/util/value.h b/src/lib/util/value.h index 9fd9b025eab..8806d25366e 100644 --- a/src/lib/util/value.h +++ b/src/lib/util/value.h @@ -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;