[systemd-devel] [PATCH] coredumpctl: check return of strndup

Lukas Nykryn lnykryn at redhat.com
Wed Dec 19 05:38:53 PST 2012


---
 src/journal/coredumpctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index f9cebb7..4f0ed58 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -262,7 +262,7 @@ static int retrieve(const void *data,
                 return 0;
 
         *var = strndup((const char*)data + ident, len - ident);
-        if (!var)
+        if (!*var)
                 return log_oom();
 
         return 0;
-- 
1.7.11.7



More information about the systemd-devel mailing list