Set pl_lookup_table to NULL after freeing: allow another initialization

This commit is contained in:
Holger Vogt 2024-06-23 17:00:24 +02:00
parent 07b10bc1a1
commit c61fc35231
1 changed files with 2 additions and 0 deletions

View File

@ -965,6 +965,7 @@ static void killplot(struct plot *pl)
/* delete the hash table entry for this plot */
if (pl->pl_lookup_table) {
nghash_free(pl->pl_lookup_table, NULL, NULL);
pl->pl_lookup_table = NULL;
}
txfree(pl->pl_title);
txfree(pl->pl_name);
@ -998,6 +999,7 @@ destroy_const_plot(void)
/* delete the hash table entry for the const plot */
if (pl->pl_lookup_table) {
nghash_free(pl->pl_lookup_table, NULL, NULL);
pl->pl_lookup_table = NULL;
}
wl_free(pl->pl_commands);
if (pl->pl_ccom) /* va: also tfree (memory leak) */