Wireshark-bugs: [Wireshark-bugs] [Bug 8089] New Dissector - SEL (Schweitzer Engineering Laborato

Date: Tue, 18 Dec 2012 00:52:28 +0000

Comment # 11 on bug 8089 from
Thanks for the update, Chris.

Regarding the memory leak, an extra thank you for pointing out your source - it
looks like packet-synphasor also leaks, so somebody will have to fix that :)

I can't point to any precise examples off the top of my head, but in general it
looks like you're implementing conversation management, in which case I would
point you to section 2.2 of README.developer. Note the use wmem memory in the
example (section 2.2.3) such that the memory doesn't have to be manually freed,
nor does it need to be specially protected in the case of an exception - the
library handles everything for you when the capture file is closed.

Also, GCC (the linux compiler) still has some issues with the file that are
worth fixing:

packet-selfm.c: In function 'dissect_fmconfig_frame':
packet-selfm.c:999:78: warning: variable 'num_calc' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:999:69: warning: variable 'num_dig' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:999:59: warning: variable 'num_samp' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:999:43: warning: variable 'num_sf' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:999:35: warning: variable 'sf_loc' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:999:24: warning: variable 'num_flags' set but not used
[-Wunused-but-set-variable]
packet-selfm.c: In function 'dissect_fastser_frame':
packet-selfm.c:1410:91: warning: variable 'crc16' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:1410:82: warning: variable 'reg_val' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:1410:62: warning: variable 'year' set but not used
[-Wunused-but-set-variable]
packet-selfm.c:1410:49: warning: variable 'day_of_year' set but not used
[-Wunused-but-set-variable]
packet-selfm.c: In function 'get_selfm_len':
packet-selfm.c:2081:5: error: 'message_len' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
packet-selfm.c: In function 'dissect_selfm':
packet-selfm.c:1038:16: error: array subscript is above array bounds
[-Werror=array-bounds]
packet-selfm.c:1652:27: error: 'elmt_status32_ofs' may be used uninitialized in
this function [-Werror=maybe-uninitialized]
packet-selfm.c:1406:38: note: 'elmt_status32_ofs' was declared here
packet-selfm.c:1172:47: error: 'ch_size' may be used uninitialized in this
function [-Werror=maybe-uninitialized]
packet-selfm.c:1074:31: note: 'ch_size' was declared here
packet-selfm.c:1172:47: error: 'fmdata_ai_tree' may be used uninitialized in
this function [-Werror=maybe-uninitialized]
packet-selfm.c:1068:37: note: 'fmdata_ai_tree' was declared here


You are receiving this mail because:
  • You are watching all bug changes.