[dev] [surf] leak and segfault patches

From: Rob <robpilling_AT_gmail.com>
Date: Sun, 25 Jul 2010 15:50:59 +0100

Hi, I found a few problems when I was messing around with surf this afternoon.

The first patch should fix a memory leak that happens when surf loads a new uri.
I tried to check with debug flags and valgrind, but, after sifting
through the usual thousand or so GTK leaks, invalid writes and other
assorted problems, I found nothing, although the patch makes sense,
given that 'u' is g_free()'d in one branch of the if-statement, but
not the other.

The second patch fixes a null pointer dereference that I got when
refreshing a page while it was still loading. I'm pretty certain 'w'
was null because valgrind reported line 256 as the error, and the only
pointer dereference on that line is w->window. Either that or one of
the function arguments was null and surf segfaulted inside a gtk
function. Typically, by the time I realised this, the valgrind log was
lost to the oblivion, so it's tough luck there.


Received on Sun Jul 25 2010 - 16:50:59 CEST

This archive was generated by hypermail 2.2.0 : Sun Jul 25 2010 - 17:00:04 CEST