[ostree] repo: Don't call g_hash_table_destroy on a NULL hash
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [ostree] repo: Don't call g_hash_table_destroy on a NULL hash
- Date: Thu, 1 Dec 2011 01:34:17 +0000 (UTC)
commit 247e027125b4b56a9543042a382677aca81c78cc
Author: Colin Walters <walters verbum org>
Date: Wed Nov 30 20:23:10 2011 -0500
repo: Don't call g_hash_table_destroy on a NULL hash
src/libostree/ostree-repo.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c
index 1ba6324..f87bd33 100644
--- a/src/libostree/ostree-repo.c
+++ b/src/libostree/ostree-repo.c
@@ -1197,9 +1197,12 @@ import_directory_recurse (OstreeRepo *self,
g_clear_object (&dir_enum);
g_clear_object (&child);
g_clear_object (&child_info);
- g_hash_table_destroy (file_checksums);
- g_hash_table_destroy (dir_metadata_checksums);
- g_hash_table_destroy (dir_contents_checksums);
+ if (file_checksums)
+ g_hash_table_destroy (file_checksums);
+ if (dir_metadata_checksums)
+ g_hash_table_destroy (dir_metadata_checksums);
+ if (dir_contents_checksums)
+ g_hash_table_destroy (dir_contents_checksums);
ot_clear_checksum (&ret_metadata_checksum);
ot_clear_checksum (&ret_contents_checksum);
ot_clear_checksum (&child_file_checksum);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]