[Click] click-uninstall error

Bart Braem bart.braem at ua.ac.be
Tue Nov 30 02:54:18 EST 2004


> void IPStats::clean_map() {>                 FlowInfo *fi;>     for (Map::iterator iter = _map.begin(); iter; iter++)> {       //Clean Flow map>             fi = iter.value();>                         if (fi != 0)>         delete fi;>     };>                 potential_supernodes.clear();>                 for (Map::iterator iter = _to_clean_map.begin(); iter;> iter++) {       //Clean any entries left in timedout or reset> flows>                                 fi = iter.value();>                                 if (fi != 0)>                                                 delete fi;>                 };> };
Firstly: as far as I know deleting 0 is ok, so you don't need the if (fi != 0) condition.But then: where is the nullpointer dereferencing? I'd go for potential_supernodes.clear(), this code seems fine to me, if your maps don't contain any objects with your own destructors. In that case they might chain into some nullpointer dereference far, far way...
Hope this helps,Bart


More information about the click mailing list