forked from enlightenment/efl
Fix potential double-free of so->answer.
NB: dns_so_submit calls dns_so_reset twice (once at start, once at end on error). As so_reset will free so->answer the first time through, add validity check of so->answer for the second iteration. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
b211a27d67
commit
0f925220e1
|
@ -5525,7 +5525,7 @@ void dns_so_close(struct dns_socket *so) {
|
|||
|
||||
|
||||
void dns_so_reset(struct dns_socket *so) {
|
||||
free(so->answer);
|
||||
if (so->answer) free(so->answer);
|
||||
|
||||
memset(&so->state, '\0', sizeof *so - offsetof(struct dns_socket, state));
|
||||
} /* dns_so_reset() */
|
||||
|
|
Loading…
Reference in New Issue