From 16fb81cd7e3a3586252fc5d185e5c2c95125d045 Mon Sep 17 00:00:00 2001 From: Michael Catanzaro Date: Fri, 21 Jun 2019 09:58:15 -0500 Subject: [PATCH] Add some g_return checks to gvdb_table_write_contents() I'm not auditing all the public functions in this file for precondition checks, but since I'm adding an async version of this function, it makes sense to ensure there are matching checks for the sync version. --- gvdb-builder.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gvdb-builder.c b/gvdb-builder.c index 55b451334..ff28edf20 100644 --- a/gvdb-builder.c +++ b/gvdb-builder.c @@ -511,6 +511,10 @@ gvdb_table_write_contents (GHashTable *table, FileBuilder *fb; GString *str; + g_return_val_if_fail (table != NULL, FALSE); + g_return_val_if_fail (filename != NULL, FALSE); + g_return_val_if_fail (error == NULL || *error == NULL, FALSE); + fb = file_builder_new (byteswap); file_builder_add_hash (fb, table, &root); str = file_builder_serialise (fb, root);