Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/2b2bbbe76502b6cb528752a2dad89d3f1f6c6409
...commit
http://git.netsurf-browser.org/netsurf.git/commit/2b2bbbe76502b6cb528752a2dad89d3f1f6c6409
...tree
http://git.netsurf-browser.org/netsurf.git/tree/2b2bbbe76502b6cb528752a2dad89d3f1f6c6409
The branch, master has been updated
via 2b2bbbe76502b6cb528752a2dad89d3f1f6c6409 (commit)
from c4c2c22e87ba5018d0a90abfc01af51da996e3b5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=2b2bbbe76502b6cb528752a2dad89d3f1f6c6409
commit 2b2bbbe76502b6cb528752a2dad89d3f1f6c6409
Author: Vincent Sanders <[email protected]>
Commit: Vincent Sanders <[email protected]>
fix resource leak on error in local history initialisation
diff --git a/desktop/local_history.c b/desktop/local_history.c
index fe7f4a9..01222e2 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -259,24 +259,15 @@ find_entry_position(struct history_entry *entry, int x,
int y)
/* exported interface documented in desktop/local_history.h */
-nserror local_history_init(struct core_window_callback_table *cw_t,
- void *core_window_handle,
- struct browser_window *bw,
- struct local_history_session **session)
+nserror
+local_history_init(struct core_window_callback_table *cw_t,
+ void *core_window_handle,
+ struct browser_window *bw,
+ struct local_history_session **session)
{
nserror res;
struct local_history_session *nses;
- nses = calloc(1, sizeof(struct local_history_session));
- if (nses == NULL) {
- return NSERROR_NOMEM;
- }
-
- nses->cw_t = cw_t;
- nses->core_window_handle = core_window_handle;
-
- local_history_set(nses, bw);
-
res = ns_system_colour_char("Window", &pstyle_bg.fill_colour);
if (res != NSERROR_OK) {
return res;
@@ -297,8 +288,18 @@ nserror local_history_init(struct
core_window_callback_table *cw_t,
}
pfstyle_node_sel.foreground = pstyle_rect_sel.stroke_colour;
+ nses = calloc(1, sizeof(struct local_history_session));
+ if (nses == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ nses->cw_t = cw_t;
+ nses->core_window_handle = core_window_handle;
+
+ local_history_set(nses, bw);
*session = nses;
+
return NSERROR_OK;
}
-----------------------------------------------------------------------
Summary of changes:
desktop/local_history.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/desktop/local_history.c b/desktop/local_history.c
index fe7f4a9..01222e2 100644
--- a/desktop/local_history.c
+++ b/desktop/local_history.c
@@ -259,24 +259,15 @@ find_entry_position(struct history_entry *entry, int x,
int y)
/* exported interface documented in desktop/local_history.h */
-nserror local_history_init(struct core_window_callback_table *cw_t,
- void *core_window_handle,
- struct browser_window *bw,
- struct local_history_session **session)
+nserror
+local_history_init(struct core_window_callback_table *cw_t,
+ void *core_window_handle,
+ struct browser_window *bw,
+ struct local_history_session **session)
{
nserror res;
struct local_history_session *nses;
- nses = calloc(1, sizeof(struct local_history_session));
- if (nses == NULL) {
- return NSERROR_NOMEM;
- }
-
- nses->cw_t = cw_t;
- nses->core_window_handle = core_window_handle;
-
- local_history_set(nses, bw);
-
res = ns_system_colour_char("Window", &pstyle_bg.fill_colour);
if (res != NSERROR_OK) {
return res;
@@ -297,8 +288,18 @@ nserror local_history_init(struct
core_window_callback_table *cw_t,
}
pfstyle_node_sel.foreground = pstyle_rect_sel.stroke_colour;
+ nses = calloc(1, sizeof(struct local_history_session));
+ if (nses == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ nses->cw_t = cw_t;
+ nses->core_window_handle = core_window_handle;
+
+ local_history_set(nses, bw);
*session = nses;
+
return NSERROR_OK;
}
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org