summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-nfs.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2009-10-25 11:43:30 +0000
committerAnders Broman <anders.broman@ericsson.com>2009-10-25 11:43:30 +0000
commit88bb44a51e350c9749323242482dc5e944697d8f (patch)
treea19835aec094d07536c6def639d5d5d236f0a1cd /epan/dissectors/packet-nfs.c
parent337896f4c6777bc0b84a2e017ebcbb52100a312b (diff)
downloadwireshark-88bb44a51e350c9749323242482dc5e944697d8f.tar.gz
From Jakub Zawadzki:
Cleanup dissector code - use proper memory functions. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4164 svn path=/trunk/; revision=30691
Diffstat (limited to 'epan/dissectors/packet-nfs.c')
-rw-r--r--epan/dissectors/packet-nfs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/epan/dissectors/packet-nfs.c b/epan/dissectors/packet-nfs.c
index db04ea401a..72f0219bea 100644
--- a/epan/dissectors/packet-nfs.c
+++ b/epan/dissectors/packet-nfs.c
@@ -676,8 +676,7 @@ store_nfs_file_handle(nfs_fhandle_data_t *nfs_fh)
fhlen=nfs_fh->len/4;
/* align the file handle data */
- fhdata=g_malloc(fhlen*4);
- memcpy(fhdata, nfs_fh->fh, fhlen*4);
+ fhdata=g_memdup(nfs_fh->fh, fhlen*4);
fhkey[0].length=1;
fhkey[0].key=&fhlen;
fhkey[1].length=fhlen;
@@ -963,8 +962,7 @@ nfs_name_snoop_fh(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int fh_of
fhlen=nns->fh_length;
/* align it */
- fhdata=g_malloc(fhlen);
- memcpy(fhdata, nns->fh, fhlen);
+ fhdata=g_memdup(nns->fh, fhlen);
fhkey[0].length=1;
fhkey[0].key=&fhlen;
fhkey[1].length=fhlen/4;