aboutsummaryrefslogtreecommitdiffstats
path: root/epan/oids.c
diff options
context:
space:
mode:
authorEvan Huus <eapache@gmail.com>2015-01-22 20:53:24 -0500
committerEvan Huus <eapache@gmail.com>2015-01-23 01:56:17 +0000
commit2eaa467b34d78b216a1ba9305bd23a9196209b3b (patch)
tree6734f720f285c30c2c817817b6d1d5b3c60491b6 /epan/oids.c
parent612e286b9eed3f011a592a206f0128d0b04e5549 (diff)
oids: fix memory leak
In oid_encoded2subid_sub(), the scope we get may be NULL, in which case if we don't return our allocated buffer, it is our responsibility to free it. Minor regression from ge333e4c90f0aca41b0a56cef22fd80d0b0e73e14. Bug: 10883 Change-Id: I324ca770278ab0575511c5e9ab72b70d6ac1a391 Reviewed-on: https://code.wireshark.org/review/6748 Reviewed-by: Evan Huus <eapache@gmail.com>
Diffstat (limited to 'epan/oids.c')
-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;
}