From f80b2bb50ed6060b99f3d8f9abd25589c2ca08cb Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Sat, 20 Jun 2020 08:04:25 +0200 Subject: [PATCH] python: check if hashtable is NULL before deallocatio (#44287)n --- bindings/python/lang.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python/lang.py b/bindings/python/lang.py index 470e35cd..85f0584c 100644 --- a/bindings/python/lang.py +++ b/bindings/python/lang.py @@ -91,7 +91,7 @@ class Binding: k_type = key_type(type) v_type = value_type(type) if is_cstring(el_type) or (is_cstring(k_type) and is_cstring(v_type)): - print_(' g_hash_table_destroy(%s);' % name, file=fd) + print_(' if (%s) { g_hash_table_destroy(%s); }' % (name, name), file=fd) else: raise Exception('Unsupported free value of type GHashTable: %s' % type) elif is_object(type):