summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-15 12:02:22 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-15 12:03:32 +0100
commitb5599b8e369c747ee54902f9467288f3713f93bc (patch)
tree79b2107ed3117c0368cf9ed5b6663353eb8165d2 /build-aux
parent9a51ad256f29b213a4288bf5a3e85b6fd73c853f (diff)
qmi-codegen,field: plug memleak when processing errors in printable output
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/qmi-codegen/Field.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/build-aux/qmi-codegen/Field.py b/build-aux/qmi-codegen/Field.py
index 8a09dc0..80c5c9e 100644
--- a/build-aux/qmi-codegen/Field.py
+++ b/build-aux/qmi-codegen/Field.py
@@ -380,8 +380,10 @@ class Field:
' g_string_append_printf (printable, "Additional unexpected \'%" G_GSIZE_FORMAT "\' bytes", offset);\n'
'\n'
'out:\n'
- ' if (error)\n'
+ ' if (error) {\n'
' g_string_append_printf (printable, " ERROR: %s", error->message);\n'
+ ' g_error_free (error);\n'
+ ' }\n'
' return g_string_free (printable, FALSE);\n'
'}\n')
f.write(string.Template(template).substitute(translations))