mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +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:
parent
d6ea9ea18a
commit
cb226847e5
1 changed files with 3 additions and 4 deletions
|
|
@ -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",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue