aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--epan/oids.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/epan/oids.c b/epan/oids.c
index 463fe692b9..7489b2792c 100644
--- a/epan/oids.c
+++ b/epan/oids.c
@@ -1009,7 +1009,10 @@ guint oid_encoded2subid_sub(wmem_allocator_t *scope, const guint8 *oid_bytes, gi
}
if( subids >= subid_overflow || subid > 0xffffffff) {
- *subids_p=NULL;
+ /* scope may be NULL in which case we must free our
+ * useless buffer before returning */
+ wmem_free(scope, *subids_p);
+ *subids_p = NULL;
return 0;
}