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.
This commit is contained in:
Guy Harris 2021-05-21 19:14:03 -07:00
parent f1ffe7d421
commit f0abd29e48
1 changed files with 2 additions and 0 deletions

View File

@ -1450,11 +1450,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;
}
}