protobuf: Fix leaking nodes and strings

Closes #17305
This commit is contained in:
Tomasz Moń 2021-04-01 17:46:05 +02:00 committed by Wireshark GitLab Utility
parent c280ee9234
commit 4c16875759
2 changed files with 2 additions and 1 deletions

View File

@ -524,7 +524,7 @@ exIdent ::= PT_IDENT.
strLit(A) ::= PT_STRLIT(B). { A = pbl_store_string_token(state, g_strndup(B->v + 1, strlen(B->v) - 2)); }
/* support one string being splitted into multi-lines */
strLit(A) ::= strLit(B) PT_STRLIT(C). { A = pbl_store_string_token(state, g_strconcat(B, g_strndup(C->v + 1, strlen(C->v) - 2), NULL)); }
strLit(A) ::= strLit(B) PT_STRLIT(C). { gchar *v = g_strndup(C->v + 1, strlen(C->v) - 2); A = pbl_store_string_token(state, g_strconcat(B, v, NULL)); g_free(v); }
%code {

View File

@ -1172,6 +1172,7 @@ pbl_free_node(gpointer anode)
if (node->children_by_name) {
g_hash_table_destroy(node->children_by_name);
}
g_free(node);
}
/*