diff options
Diffstat (limited to 'plugins/kaitai/record.c')
| -rw-r--r-- | plugins/kaitai/record.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/plugins/kaitai/record.c b/plugins/kaitai/record.c index 5717b17..de1e80d 100644 --- a/plugins/kaitai/record.c +++ b/plugins/kaitai/record.c @@ -115,6 +115,10 @@ static void g_match_record_init(GMatchRecord *record) static void g_match_record_dispose(GMatchRecord *record) { + g_clear_object(&record->creator); + + g_clear_object(&record->content); + G_OBJECT_CLASS(g_match_record_parent_class)->dispose(G_OBJECT(record)); } @@ -331,12 +335,16 @@ static GMatchRecord *_g_match_record_find_by_name(GMatchRecord *record, const ch { label = g_kaitai_attribute_get_label(G_KAITAI_ATTRIBUTE(record->creator)); - label_len = strlen(label); - - if (label_len == len && strncmp(label, name, len) == 0) + if (label != NULL) { - result = record; - g_object_ref(G_OBJECT(result)); + label_len = strlen(label); + + if (label_len == len && strncmp(label, name, len) == 0) + { + result = record; + g_object_ref(G_OBJECT(result)); + } + } } |
