From 2ef907e901d146642adc758fe87ca9e580bfece9 Mon Sep 17 00:00:00 2001 From: Alexander Bokovoy Date: May 24 2021 06:11:07 +0000 Subject: Return early if ret allocation has failed Fixes reports from a GCC analyzer Signed-off-by: Alexander Bokovoy --- diff --git a/src/back-nis.c b/src/back-nis.c index adf378e..2001222 100644 --- a/src/back-nis.c +++ b/src/back-nis.c @@ -488,6 +488,9 @@ backend_map_config_filter(const char *format, } } ret = malloc(l + 1); + if (ret == NULL) { + return NULL; + } for (i = j = 0; format[i] != '\0'; i++) { if (format[i] == '%') { switch (format[i + 1]) {