Patrick McHardy wrote: > jamal wrote: > >>All the way down, you call func with a NULL entry. You could add a check >>to make sure it only gets invoked when last is not null, but the result >>is in such a case, you will never send a 0 count element. I am sure >>there could be other tricky scenarios like this that could be >>constructed. >> >>Thoughts. > > > Double sending can't happen, but you're right about potentially > sending a NULL ptr when after setting it to NULL we don't find > any other matching elements. > > This patch should fix it (and is even simpler), by moving the > check for pol->type != type before sending, we make sure that > last always contains a valid element unless count == 0. > > Also fixed an incorrect gcc warning about last_dir potentially > being used uninitialized. And again for SAs ..