1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-25 17:09:02 +00:00

Move a couple of allocated string variables into the same scope where

they are freed to avoid a memory leak.
This commit is contained in:
david
2009-08-24 21:02:32 +00:00
parent d6ea9ea18a
commit cb226847e5

View File

@@ -771,12 +771,11 @@ void l_nsock_trace(nsock_iod nsiod, const char *message, int direction)
struct sockaddr remote;
char *ipstring_local = (char *) safe_malloc(sizeof(char) * INET6_ADDRSTRLEN);
char *ipstring_remote = (char *) safe_malloc(sizeof(char) * INET6_ADDRSTRLEN);
if (!nsi_is_pcap(nsiod))
{
char *ipstring_local = (char *) safe_malloc(sizeof(char) * INET6_ADDRSTRLEN);
char *ipstring_remote = (char *) safe_malloc(sizeof(char) * INET6_ADDRSTRLEN);
status = nsi_getlastcommunicationinfo(nsiod, &protocol, &af,
&local, &remote, sizeof(sockaddr));
log_write(LOG_STDOUT, "%s: %s %s:%d %s %s:%d | %s\n",