Skip to content
Snippets Groups Projects
Commit 2e16a35f authored by Michael Tüxen's avatar Michael Tüxen
Browse files

Free only allocated memory.

parent c26d420b
No related branches found
No related tags found
No related merge requests found
...@@ -3473,6 +3473,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -3473,6 +3473,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
#if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED) || defined(SCTP_ENABLE_STREAM_RESET) #if defined(SCTP_MAXSEG) || defined(SCTP_MAX_BURST) || defined(SCTP_INTERLEAVING_SUPPORTED) || defined(SCTP_ENABLE_STREAM_RESET)
struct sctp_assoc_value assoc_value; struct sctp_assoc_value assoc_value;
#endif #endif
#ifdef SCTP_HMAC_IDENT
struct sctp_hmacalgo *hmacalgo = NULL;
#endif
#ifdef SCTP_AUTH_ACTIVE_KEY #ifdef SCTP_AUTH_ACTIVE_KEY
struct sctp_authkeyid authkeyid; struct sctp_authkeyid authkeyid;
#endif #endif
...@@ -3515,6 +3518,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -3515,6 +3518,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
#ifdef SCTP_AUTH_CHUNK #ifdef SCTP_AUTH_CHUNK
struct sctp_authchunk authchunk; struct sctp_authchunk authchunk;
#endif #endif
#ifdef SCTP_AUTH_KEY
struct sctp_authkey *key = NULL;
#endif
#ifdef SCTP_PEER_ADDR_PARAMS #ifdef SCTP_PEER_ADDR_PARAMS
struct sctp_paddrparams paddrparams; struct sctp_paddrparams paddrparams;
#ifdef linux #ifdef linux
...@@ -3522,6 +3528,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -3522,6 +3528,9 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
u8 spp_dscp; u8 spp_dscp;
#endif #endif
#endif #endif
#ifdef SCTP_RESET_STREAMS
struct sctp_reset_streams *reset_streams = NULL;
#endif
#ifdef SCTP_ADD_STREAMS #ifdef SCTP_ADD_STREAMS
struct sctp_add_streams add_streams; struct sctp_add_streams add_streams;
#endif #endif
...@@ -3631,7 +3640,6 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -3631,7 +3640,6 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
#ifdef SCTP_HMAC_IDENT #ifdef SCTP_HMAC_IDENT
case EXPR_SCTP_HMACALGO: { case EXPR_SCTP_HMACALGO: {
int len, i; int len, i;
struct sctp_hmacalgo *hmacalgo;
struct expression_list *list; struct expression_list *list;
if (check_type(val_expression->value.sctp_hmacalgo->shmac_idents, EXPR_LIST, error)) { if (check_type(val_expression->value.sctp_hmacalgo->shmac_idents, EXPR_LIST, error)) {
...@@ -3892,7 +3900,6 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -3892,7 +3900,6 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
#endif #endif
#ifdef SCTP_AUTH_KEY #ifdef SCTP_AUTH_KEY
case EXPR_SCTP_AUTHKEY: { case EXPR_SCTP_AUTHKEY: {
struct sctp_authkey *key;
int i = 0, len = 0; int i = 0, len = 0;
struct expression *key_expr; struct expression *key_expr;
struct expression_list *list; struct expression_list *list;
...@@ -3990,7 +3997,6 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -3990,7 +3997,6 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
#endif #endif
#ifdef SCTP_RESET_STREAMS #ifdef SCTP_RESET_STREAMS
case EXPR_SCTP_RESET_STREAMS: { case EXPR_SCTP_RESET_STREAMS: {
struct sctp_reset_streams *reset_streams;
struct expression_list *list; struct expression_list *list;
int len = 0, i = 0; int len = 0, i = 0;
...@@ -4054,8 +4060,15 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall, ...@@ -4054,8 +4060,15 @@ static int syscall_setsockopt(struct state *state, struct syscall_spec *syscall,
result = setsockopt(live_fd, level, optname, optval, optlen); result = setsockopt(live_fd, level, optname, optval, optlen);
return end_syscall(state, syscall, CHECK_EXACT, result, error); return end_syscall(state, syscall, CHECK_EXACT, result, error);
#if defined(SCTP_HMAC_IDENT) || defined(SCTP_AUTH_KEY) || defined(SCTP_RESET_STREAMS)
free(optval); #if defined(SCTP_HMAC_IDENT)
free(hmacalgo);
#endif
#if defined(SCTP_AUTH_KEY)
free(key);
#endif
#if defined(SCTP_RESET_STREAMS)
free(reset_streams);
#endif #endif
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment