mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Use frame->name instead of target avoiding possible segfault.
This commit is contained in:
parent
5a3f77fbe2
commit
6cd9a11fdc
@ -117,10 +117,14 @@ static void
|
|||||||
delayed_goto_uri_frame(void *data)
|
delayed_goto_uri_frame(void *data)
|
||||||
{
|
{
|
||||||
struct delayed_open *deo = data;
|
struct delayed_open *deo = data;
|
||||||
|
struct frame *frame;
|
||||||
|
|
||||||
assert(deo);
|
assert(deo);
|
||||||
goto_uri_frame(deo->ses, deo->uri, deo->target, CACHE_MODE_NORMAL);
|
frame = ses_find_frame(deo->ses, deo->target);
|
||||||
|
if (frame)
|
||||||
|
goto_uri_frame(deo->ses, deo->uri, frame->name, CACHE_MODE_NORMAL);
|
||||||
done_uri(deo->uri);
|
done_uri(deo->uri);
|
||||||
|
mem_free(deo->target);
|
||||||
mem_free(deo);
|
mem_free(deo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,11 +330,13 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
deo->ses = ses;
|
deo->ses = ses;
|
||||||
deo->uri = get_uri_reference(uri);
|
deo->uri = get_uri_reference(uri);
|
||||||
deo->target = target;
|
deo->target = target;
|
||||||
|
/* target will be freed in delayed_goto_uri_frame */
|
||||||
register_bottom_half(delayed_goto_uri_frame, deo);
|
register_bottom_half(delayed_goto_uri_frame, deo);
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mem_free_if(target);
|
||||||
if (!get_cmd_opt_bool("no-connect")
|
if (!get_cmd_opt_bool("no-connect")
|
||||||
&& !get_cmd_opt_bool("no-home")
|
&& !get_cmd_opt_bool("no-home")
|
||||||
&& !get_cmd_opt_bool("anonymous")
|
&& !get_cmd_opt_bool("anonymous")
|
||||||
@ -350,7 +356,6 @@ js_window_open(struct SEE_interpreter *interp, struct SEE_object *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
mem_free_if(target);
|
|
||||||
done_uri(uri);
|
done_uri(uri);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user