- scan.c:scan_manual(): fixed memory leak
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Tue, 23 Dec 2014 18:51:47 +0000 (18:51 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Tue, 23 Dec 2014 18:51:47 +0000 (18:51 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/trunk@5089 82007160-df01-0410-b94d-b575c5fd34c7

src/scan.c

index aa7ba887d5b742f58b06cdd090ab76e9eaa36d95..eae8c88ab23615d064afcae79321029c3dcd7086 100644 (file)
@@ -1008,8 +1008,6 @@ void scan_manual(char *param, struct ChannelConf *target)
       scannername++;
    }
 
-   ss = MyMalloc(sizeof *ss);
-
    /* If IP is a hostname, resolve it using gethostbyname (which will block!) */
    if (!(addr = firedns_resolveip4(ip)))
    {
@@ -1021,6 +1019,8 @@ void scan_manual(char *param, struct ChannelConf *target)
    /* IP = the resolved IP now (it was the ip OR hostname before) */
    ip = inet_ntoa(*addr);
 
+   ss = MyMalloc(sizeof *ss);
+
    /* These don't exist in a manual scan */
    ss->irc_nick     = NULL;
    ss->irc_username = NULL;