diff options
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/html.cc | 9 | ||||
-rw-r--r-- | src/image.cc | 2 | ||||
-rw-r--r-- | src/nav.c | 9 | ||||
-rw-r--r-- | src/url.c | 1 | ||||
-rw-r--r-- | src/web.cc | 6 |
6 files changed, 12 insertions, 16 deletions
@@ -46,6 +46,7 @@ dillo-2.1 - Fixed a memory leak in Html_tag_open_link(). - Fixed a memory leak in Klist(). - Fix the comment for DLWin::del() (dpi/downloads.cc). + - Removed redundant caller NULL checks already in the API. Patches: Jeremy Henty +- Implemented Basic authentication! Patch: Jeremy Henty, Jorge Arellano Cid diff --git a/src/html.cc b/src/html.cc index 9fd1234d..d887b620 100644 --- a/src/html.cc +++ b/src/html.cc @@ -511,8 +511,7 @@ DilloHtml::~DilloHtml() a_Url_free(base_url); for (int i = 0; i < cssUrls->size(); i++) - if (cssUrls->get(i)) - a_Url_free(cssUrls->get(i)); + a_Url_free(cssUrls->get(i)); delete (cssUrls); for (int i = 0; i < forms->size(); i++) @@ -524,15 +523,13 @@ DilloHtml::~DilloHtml() delete(inputs_outside_form); for (int i = 0; i < links->size(); i++) - if (links->get(i)) - a_Url_free(links->get(i)); + a_Url_free(links->get(i)); delete (links); for (int i = 0; i < images->size(); i++) { DilloLinkImage *li = images->get(i); a_Url_free(li->url); - if (li->image) - a_Image_unref(li->image); + a_Image_unref(li->image); dFree(li); } delete (images); diff --git a/src/image.cc b/src/image.cc index 63d630c7..8ecf2a72 100644 --- a/src/image.cc +++ b/src/image.cc @@ -65,6 +65,7 @@ static void Image_free(DilloImage *Image) /* * Unref and free if necessary + * Do nothing if the argument is NULL */ void a_Image_unref(DilloImage *Image) { @@ -75,6 +76,7 @@ void a_Image_unref(DilloImage *Image) /* * Add a reference to an Image struct + * Do nothing if the argument is NULL */ void a_Image_ref(DilloImage *Image) { @@ -249,10 +249,8 @@ static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url, int offset) void a_Nav_cancel_expect(BrowserWindow *bw) { if (bw->nav_expecting) { - if (bw->nav_expect_url) { - a_Url_free(bw->nav_expect_url); - bw->nav_expect_url = NULL; - } + a_Url_free(bw->nav_expect_url); + bw->nav_expect_url = NULL; bw->nav_expecting = FALSE; } if (bw->meta_refresh_status > 0) @@ -416,8 +414,7 @@ void a_Nav_redirection0(BrowserWindow *bw, const DilloUrl *new_url) dReturn_if_fail (bw != NULL); _MSG(">>> a_Nav_redirection0 <<<<\n"); - if (bw->meta_refresh_url) - a_Url_free(bw->meta_refresh_url); + a_Url_free(bw->meta_refresh_url); bw->meta_refresh_url = a_Url_dup(new_url); a_Url_set_flags(bw->meta_refresh_url, URL_FLAGS(new_url)|URL_E2EQuery|URL_IgnoreScroll); @@ -190,6 +190,7 @@ static DilloUrl *Url_object_new(const char *uri_str) /* * Free a DilloUrl + * Do nothing if the argument is NULL */ void a_Url_free(DilloUrl *url) { @@ -139,10 +139,8 @@ int a_Web_valid(DilloWeb *web) void a_Web_free(DilloWeb *web) { if (!web) return; - if (web->url) - a_Url_free(web->url); - if (web->Image) - a_Image_unref(web->Image); + a_Url_free(web->url); + a_Image_unref(web->Image); dFree(web->filename); dList_remove(ValidWebs, (void *)web); dFree(web); |