Commit e8b37a84 authored by Jiri Popelka's avatar Jiri Popelka

netstat memory leak fixed.

valgrind --leak-check=full netstat
(x86_64)

before:
  definitely lost: 1,536 bytes in 64 blocks
  indirectly lost: 479 bytes in 64 blocks
 ERROR SUMMARY: 1 errors from 1 contexts

after:
  definitely lost: 0 bytes in 0 blocks
  indirectly lost: 0 bytes in 0 blocks
 ERROR SUMMARY: 0 errors from 0 contexts
parent 992a1def
......@@ -396,6 +396,9 @@ static int read_services(void)
add2list(&udp_name, item);
} else if (!strcmp(se->s_proto, "raw")) {
add2list(&raw_name, item);
} else { /* sctp, ddp, dccp */
free(item->name);
free(item);
}
}
endservent();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment