mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
1033: Fixed memory leak in open(...).
This commit is contained in:
parent
2668602edc
commit
e9f3a4a9d3
@ -240,7 +240,7 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
struct document_view *doc_view = vs->doc_view;
|
struct document_view *doc_view = vs->doc_view;
|
||||||
struct session *ses = doc_view->session;
|
struct session *ses = doc_view->session;
|
||||||
unsigned char *frame = "";
|
unsigned char *frame = "";
|
||||||
unsigned char *url;
|
unsigned char *url, *url2;
|
||||||
struct uri *uri;
|
struct uri *uri;
|
||||||
struct SEE_value url_value;
|
struct SEE_value url_value;
|
||||||
#if 0
|
#if 0
|
||||||
@ -291,10 +291,11 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
}
|
}
|
||||||
/* TODO: Support for window naming and perhaps some window features? */
|
/* TODO: Support for window naming and perhaps some window features? */
|
||||||
|
|
||||||
url = join_urls(doc_view->document->uri, url);
|
url2 = join_urls(doc_view->document->uri, url);
|
||||||
if (!url) return;
|
|
||||||
uri = get_uri(url, 0);
|
|
||||||
mem_free(url);
|
mem_free(url);
|
||||||
|
if (!url2) return;
|
||||||
|
uri = get_uri(url2, 0);
|
||||||
|
mem_free(url2);
|
||||||
if (!uri) return;
|
if (!uri) return;
|
||||||
|
|
||||||
if (*frame && strcasecmp(frame, "_blank")) {
|
if (*frame && strcasecmp(frame, "_blank")) {
|
||||||
|
@ -342,7 +342,7 @@ window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||||||
struct document_view *doc_view;
|
struct document_view *doc_view;
|
||||||
struct session *ses;
|
struct session *ses;
|
||||||
unsigned char *frame = "";
|
unsigned char *frame = "";
|
||||||
unsigned char *url;
|
unsigned char *url, *url2;
|
||||||
struct uri *uri;
|
struct uri *uri;
|
||||||
static time_t ratelimit_start;
|
static time_t ratelimit_start;
|
||||||
static int ratelimit_count;
|
static int ratelimit_count;
|
||||||
@ -387,10 +387,13 @@ window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
|||||||
|
|
||||||
/* TODO: Support for window naming and perhaps some window features? */
|
/* TODO: Support for window naming and perhaps some window features? */
|
||||||
|
|
||||||
url = join_urls(doc_view->document->uri, url);
|
url2 = join_urls(doc_view->document->uri, url);
|
||||||
if (!url) return JS_TRUE;
|
|
||||||
uri = get_uri(url, 0);
|
|
||||||
mem_free(url);
|
mem_free(url);
|
||||||
|
if (!url2) {
|
||||||
|
return JS_TRUE;
|
||||||
|
}
|
||||||
|
uri = get_uri(url2, 0);
|
||||||
|
mem_free(url2);
|
||||||
if (!uri) return JS_TRUE;
|
if (!uri) return JS_TRUE;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user