From a38c56370c25da2e3bb67e38306b264cd1361e56 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Thu, 13 Jun 2013 15:43:50 +0200 Subject: torture: Fix a resource leak on error. --- tests/torture.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests') diff --git a/tests/torture.c b/tests/torture.c index a75b0a9..2a49f0d 100644 --- a/tests/torture.c +++ b/tests/torture.c @@ -110,6 +110,7 @@ int torture_rmdirs(const char *path) { len = strlen(path) + strlen(dp->d_name) + 2; fname = malloc(len); if (fname == NULL) { + closedir(d); return -1; } snprintf(fname, len, "%s/%s", path, dp->d_name); -- cgit