summaryrefslogtreecommitdiff
path: root/psi/iname.c
diff options
context:
space:
mode:
Diffstat (limited to 'psi/iname.c')
-rw-r--r--psi/iname.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/psi/iname.c b/psi/iname.c
index 88cc938fe..a2e234924 100644
--- a/psi/iname.c
+++ b/psi/iname.c
@@ -102,9 +102,7 @@ names_init(ulong count, gs_ref_memory_t *imem)
int code = name_alloc_sub(nt);
if (code < 0) {
- while (nt->sub_next > 0)
- name_free_sub(nt, --(nt->sub_next), false);
- gs_free_object(mem, nt, "name_init(nt)");
+ names_free(nt);
return 0;
}
}
@@ -131,6 +129,17 @@ names_init(ulong count, gs_ref_memory_t *imem)
return nt;
}
+/* Free a name table */
+void
+names_free(name_table *nt)
+{
+ if (nt == NULL) return;
+
+ while (nt->sub_count > 0)
+ name_free_sub(nt, --(nt->sub_count), false);
+ gs_free_object(nt->memory, nt, "name_init(nt)");
+}
+
static void
gs_names_finalize(const gs_memory_t *cmem, void *vptr)
{