xbps_remove_binary_pkg_meta(): fix a memleak if opendir(2) fails.
--HG-- extra : convert_revision : e5a107219e809abf4a8f5fac8e066016b1d46455
This commit is contained in:
parent
500cfe4b4f
commit
4f8d329867
|
@ -81,8 +81,10 @@ xbps_remove_binary_pkg_meta(const char *pkgname)
|
|||
return errno;
|
||||
|
||||
dirp = opendir(metadir);
|
||||
if (dirp == NULL)
|
||||
if (dirp == NULL) {
|
||||
free(metadir);
|
||||
return errno;
|
||||
}
|
||||
|
||||
while ((dp = readdir(dirp)) != NULL) {
|
||||
if ((strcmp(dp->d_name, ".") == 0) ||
|
||||
|
|
Loading…
Reference in New Issue