From fdf7d22045e74adbe0e3ad0a5df4607d31c158d2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 12 Oct 2013 13:43:07 -0400
Subject: [PATCH] Make sure that we don't dereference NULL
The code was actually safe, because b should
never be null, because if rvalue is empty, a different
branch is taken. But we *do* check for NULL in the
loop above, so it's better to also check here for symmetry.
---
src/core/load-fragment.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 44920d6449..f01843d65e 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -1860,7 +1860,8 @@ int config_parse_documentation(const char *unit,
free(*a);
}
}
- *b = NULL;
+ if (b)
+ *b = NULL;
return r;
}