From 4f807791eee8ead3f38f1dce76f748fa0773f9a6 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sat, 18 May 2019 22:09:25 +0100 Subject: lib/mangle: fix possible null pointer dereference [cppcheck] Fix effects code that is used when testing util-linux, so quite low impact. Signed-off-by: Sami Kerola --- lib/mangle.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/mangle.c b/lib/mangle.c index b514cd8d3..87802fbda 100644 --- a/lib/mangle.c +++ b/lib/mangle.c @@ -155,9 +155,9 @@ int main(int argc, char *argv[]) } x = strdup(argv[2]); - unmangle_to_buffer(x, x, strlen(x) + 1); - if (x) { + unmangle_to_buffer(x, x, strlen(x) + 1); + printf("self-unmangled: '%s'\n", x); free(x); } -- cgit v1.2.3-55-g7522