aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2013-06-13 15:43:50 +0200
committerAndreas Schneider <asn@cryptomilk.org>2013-06-13 15:43:50 +0200
commita38c56370c25da2e3bb67e38306b264cd1361e56 (patch)
treeb6332cdd309ca6bac86d29edfcfc2714deb5a0ed /tests
parent01493b8d471c018613bc4684fbc80a1d4dd3d079 (diff)
downloadlibssh-a38c56370c25da2e3bb67e38306b264cd1361e56.tar.gz
libssh-a38c56370c25da2e3bb67e38306b264cd1361e56.tar.xz
libssh-a38c56370c25da2e3bb67e38306b264cd1361e56.zip
torture: Fix a resource leak on error.
Diffstat (limited to 'tests')
-rw-r--r--tests/torture.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/torture.c b/tests/torture.c
index a75b0a94..2a49f0d7 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);