diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2010-01-25 11:47:39 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2010-01-25 11:47:39 +0000 |
commit | c198fc65462567cf87c914dc7eff758f18680297 (patch) | |
tree | 03dd1faf270372972f7c1da1e0b81875d16eae54 /epan/dissectors/packet-iwarp-mpa.c | |
parent | 17a01968d9904dcf2d4a35568755866cec7224ca (diff) | |
download | wireshark-c198fc65462567cf87c914dc7eff758f18680297.tar.gz |
From Didier Gautheron via bug 4419:
se_alloc and ep_alloc never return NULL and se_alloc0 already initialized
data with 0.
svn path=/trunk/; revision=31654
Diffstat (limited to 'epan/dissectors/packet-iwarp-mpa.c')
-rw-r--r-- | epan/dissectors/packet-iwarp-mpa.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/epan/dissectors/packet-iwarp-mpa.c b/epan/dissectors/packet-iwarp-mpa.c index 07baaae128..856e1dde98 100644 --- a/epan/dissectors/packet-iwarp-mpa.c +++ b/epan/dissectors/packet-iwarp-mpa.c @@ -208,27 +208,10 @@ typedef struct mpa_state mpa_state_t; static mpa_state_t * init_mpa_state(void) { - mpa_state_t *state= NULL; - guint i; - - state = (mpa_state_t *) se_alloc(sizeof(mpa_state_t)); - - if (state != NULL) { - state->full_operation = FALSE; - state->req_frame_num = 0; - state->rep_frame_num = 0; - state->ini_exp_m_res = FALSE; - state->res_exp_m_ini = FALSE; - for (i=0; i<2; i++) { - state->minfo[i].port = 0; - state->minfo[i].seq = 0; - state->minfo[i].valid = FALSE; - } - state->crc = FALSE; - state->revision = -1; - } else { - THROW(OutOfMemoryError); - } + mpa_state_t *state; + + state = (mpa_state_t *) se_alloc0(sizeof(mpa_state_t)); + state->revision = -1; return state; } |