protobuf: close another leak.

Close the directory handle we've opened before returning a failure
indication if pbw_load_proto_file() or load_all_files_in_dir() reports a
failure.


(cherry picked from commit f0abd29e48)
This commit is contained in:
Guy Harris 2021-05-21 19:14:03 -07:00
parent 161e765500
commit 0e6c7c7bb2
1 changed files with 2 additions and 0 deletions

View File

@ -1144,11 +1144,13 @@ load_all_files_in_dir(PbwDescriptorPool* pool, const gchar* dir_path)
/* Note: pbw_load_proto_file support absolute or relative (to one of search paths) path */
if (pbw_load_proto_file(pool, path) != 0) {
g_free(path);
ws_dir_close(dir);
return FALSE;
}
} else {
if (!load_all_files_in_dir(pool, path)) {
g_free(path);
ws_dir_close(dir);
return FALSE;
}
}