summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con/dns.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-08-05 13:48:23 +0100
committerChris Michael <cp.michael@samsung.com>2013-08-05 13:48:23 +0100
commit0f925220e1054cdde9e6c04a3330c4d9ff9e7ea8 (patch)
treeb56d9c0e527b86618686e896a334a7d2b1aff5a6 /src/lib/ecore_con/dns.c
parentb211a27d6711460998a494649e0c5b9967865b1f (diff)
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>
Diffstat (limited to 'src/lib/ecore_con/dns.c')
-rw-r--r--src/lib/ecore_con/dns.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecore_con/dns.c b/src/lib/ecore_con/dns.c
index 7a0d5e1..b4564e5 100644
--- a/src/lib/ecore_con/dns.c
+++ b/src/lib/ecore_con/dns.c
@@ -5525,7 +5525,7 @@ void dns_so_close(struct dns_socket *so) {
5525 5525
5526 5526
5527void dns_so_reset(struct dns_socket *so) { 5527void dns_so_reset(struct dns_socket *so) {
5528 free(so->answer); 5528 if (so->answer) free(so->answer);
5529 5529
5530 memset(&so->state, '\0', sizeof *so - offsetof(struct dns_socket, state)); 5530 memset(&so->state, '\0', sizeof *so - offsetof(struct dns_socket, state));
5531} /* dns_so_reset() */ 5531} /* dns_so_reset() */