From ef6fc488ca5672ccd46efac9de9db0cfd24bc810 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 29 Aug 2018 17:28:36 -0400 Subject: [PATCH] Fix: passing null to closedir() on error MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-crash/lttng-crash.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-crash/lttng-crash.c b/src/bin/lttng-crash/lttng-crash.c index 53de81bd4..298ed71a4 100644 --- a/src/bin/lttng-crash/lttng-crash.c +++ b/src/bin/lttng-crash/lttng-crash.c @@ -1087,7 +1087,7 @@ int delete_dir_recursive(const char *path) if (!dir) { PERROR("Cannot open '%s' path", path); ret = -errno; - goto end; + goto end_no_closedir; } path_len = strlen(path); @@ -1170,6 +1170,7 @@ end: if (closeret) { PERROR("closedir"); } +end_no_closedir: return ret; } -- 2.34.1