diff --git a/Changelog b/Changelog index b641e64..3a5c2d9 100644 --- a/Changelog +++ b/Changelog @@ -1,5 +1,13 @@ Changelog +27/08/05 (Arnout) +- giving all unknown connections their own + `unknown' process +- UDP support +- investigated memleak, turns out to be a problem in libc: + http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=273051 + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=103142 + 18/09/04 (Arnout) - also compile with gcc-3.4 diff --git a/Makefile b/Makefile index 964f81b..3946498 100644 --- a/Makefile +++ b/Makefile @@ -10,8 +10,8 @@ man8 := $(DESTDIR)/share/man/man8/ all: nethogs -#CFLAGS=-g -Wall -CFLAGS=-O2 +CFLAGS=-g -Wall +#CFLAGS=-O2 OBJS=structs.o packet.o connection.o process.o refresh.o decpcap.o cui.o inode2prog.o GCC=g++ .PHONY: tgz diff --git a/cui.cpp b/cui.cpp index 064cd73..7b90f95 100644 --- a/cui.cpp +++ b/cui.cpp @@ -268,7 +268,9 @@ void do_refresh() uid_t uid = curproc->getVal()->getUid(); if (!ROBUST) { - assert (getpwuid(uid) != NULL); + struct passwd * pwuid = getpwuid(uid); + assert (pwuid != NULL); + free (pwuid); assert (curproc->getVal()->pid >= 0); assert (n < nproc); } diff --git a/hashtbl.h b/hashtbl.h deleted file mode 100644 index 835462d..0000000 --- a/hashtbl.h +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include - -class HashNode -{ -public: - ~HashNode(); - - char * key; - void * content; - HashNode * next; -}; - -class HashTable -{ -public: - HashTable(int n_size); - ~HashTable(); - - /* after calling 'add', the calling application - * must free the string */ - void add(char * key, void * content); - void * get(char * key); - -private: - int size; - HashNode ** table; - - HashNode * newHashNode(char * key, void * content, HashNode * next); - unsigned int HashString(const char * str); - - HashTable(); // We leave this unimplemented ;) -}; diff --git a/hashtest b/hashtest deleted file mode 100755 index 0a4a7fa..0000000 Binary files a/hashtest and /dev/null differ diff --git a/nethogs.h b/nethogs.h index 1505884..873ca0b 100644 --- a/nethogs.h +++ b/nethogs.h @@ -36,7 +36,7 @@ // assertions. good for finding bugs // at an early stage of development. // for production, should be 1. -#define ROBUST 0 +#define ROBUST 1 #define REVERSEHACK 0