1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

In cache_entry_get_property and cache_entry_set_property, use

cache_entry_is_valid to check that the reference to the struct cache_entry
is still valid. Thanks to fonseca for the reminder.
This commit is contained in:
Miciah Dashiel Butler Masters 2005-12-18 22:47:58 +00:00 committed by Miciah Dashiel Butler Masters
parent 8ea7f202b1
commit 2fef4bd531

View File

@ -32,7 +32,7 @@ cache_entry_get_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
if (!cached) return JS_FALSE;
if (!cache_entry_is_valid(cached)) return JS_FALSE;
undef_to_jsval(ctx, vp);
@ -78,7 +78,7 @@ cache_entry_set_property(JSContext *ctx, JSObject *obj, jsval id, jsval *vp)
{
struct cache_entry *cached = JS_GetPrivate(ctx, obj);
if (!cached) return JS_FALSE;
if (!cache_entry_is_valid(cached)) return JS_FALSE;
if (!JSVAL_IS_INT(id))
return JS_FALSE;