From 5b3fbccab9e243901f512f9db3059a3c5eb09fe8 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 28 Aug 2019 12:39:50 -0500 Subject: [PATCH] hints: check for malloc failure --- lib/label/hints.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/label/hints.c b/lib/label/hints.c index 580304dee..6510fcf74 100644 --- a/lib/label/hints.c +++ b/lib/label/hints.c @@ -608,7 +608,8 @@ static void _filter_to_str(struct cmd_context *cmd, int filter_cfg, char **strp) return; } - str = malloc(len); + if (!(str = malloc(len))) + return; memset(str, 0, len); for (cv = cn->v; cv; cv = cv->next) { -- 2.43.5