diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-24 23:06:15 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-10-24 23:16:28 +0200 |
commit | d69bab7ba0ee12c6b261c0ca5fc0d98db7e55f0a (patch) | |
tree | a157a7273a805b64ed3d6e1da39b9ac0d816b85d /build-aux | |
parent | 872259e65dafc4f11c6c4c53f133d2939dd15bef (diff) | |
download | libmbim-d69bab7ba0ee12c6b261c0ca5fc0d98db7e55f0a.tar.gz |
build-aux,codegen: fix attempting to unref a NULL MbimTlv
Diffstat (limited to 'build-aux')
-rw-r--r-- | build-aux/mbim-codegen/Message.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/build-aux/mbim-codegen/Message.py b/build-aux/mbim-codegen/Message.py index 7a6673f..66d621e 100644 --- a/build-aux/mbim-codegen/Message.py +++ b/build-aux/mbim-codegen/Message.py @@ -1173,7 +1173,8 @@ class Message: elif field['format'] == 'struct-array' or field['format'] == 'ref-struct-array' or field['format'] == 'ms-struct-array': inner_template = (' ${struct_underscore}_array_free (_${field});\n') elif field['format'] == 'tlv': - inner_template = (' mbim_tlv_unref (_${field});\n') + inner_template = (' if (_${field})\n' + ' mbim_tlv_unref (_${field});\n') elif field['format'] == 'tlv-list': inner_template = (' g_list_free_full (_${field}, (GDestroyNotify)mbim_tlv_unref);\n') template += (string.Template(inner_template).substitute(translations)) |