diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2015-10-04 13:29:11 +0200 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2015-10-04 13:29:11 +0200 |
commit | 7301873feb87c7798654e4cf5826c7c9b93c338e (patch) | |
tree | 49fd0a494995d7ecba51ab6da7960b9d5c5e74e3 /util | |
parent | fe2b9d6d807c117d3ae2319db30326f1dcd5135c (diff) | |
download | libmtp-7301873feb87c7798654e4cf5826c7c9b93c338e.tar.gz |
close the directory on error (Coverity)
Diffstat (limited to 'util')
-rw-r--r-- | util/mtp-probe.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/util/mtp-probe.c b/util/mtp-probe.c index 600e6cd..e3ae3b7 100644 --- a/util/mtp-probe.c +++ b/util/mtp-probe.c @@ -249,8 +249,10 @@ static int check_sysfs(char *sysfspath) /* Check for dirs that identify interfaces */ ret = regcomp(&r, "^[0-9]+-[0-9]+(.[0-9])?\\:[0-9]+\\.[0-9]+$", REG_EXTENDED | REG_NOSUB); - if (ret) + if (ret) { + closedir(dir); return -1; + } while ((dent = readdir(dir))) { struct stat st; |