Enlightenment CVS committal
Author : sebastid
Project : e17
Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_con
Modified Files:
ecore_con_dns.c
Log Message:
Don't segv on early error (before malloc).
===================================================================
RCS file:
/cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_con/ecore_con_dns.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -3 -r1.11 -r1.12
--- ecore_con_dns.c 24 Aug 2005 16:20:12 -0000 1.11
+++ ecore_con_dns.c 25 Aug 2005 08:16:01 -0000 1.12
@@ -399,9 +399,9 @@
unsigned char buf[1024];
char hostname[1024];
unsigned char *p;
- char **aliases;
- struct in_addr *addrs;
- int naliases, naddrs;
+ char **aliases = NULL;
+ struct in_addr *addrs = NULL;
+ int naliases = 0, naddrs = 0;
int ancount;
struct hostent he;
@@ -454,9 +454,7 @@
p += QFIXEDSZ;
aliases = malloc((ancount + 1) * sizeof(char *));
- naliases = 0;
addrs = malloc((ancount + 1) * sizeof(struct in_addr));
- naddrs = 0;
for (i = 0; i < ancount; i++)
{
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs