summaryrefslogtreecommitdiff
path: root/src/js.c
diff options
context:
space:
mode:
authorportix <portix@gmx.net>2012-03-19 12:30:39 +0100
committerportix <portix@gmx.net>2012-03-19 12:30:39 +0100
commit0b9d58b9e1168828e26deba5c643eb8a84805f1c (patch)
treee9ba724ec11756453796409f9350906163f5702e /src/js.c
parentac5731ab3a4e659230427500cc12f0395e2a510c (diff)
downloaddwb-0b9d58b9e1168828e26deba5c643eb8a84805f1c.zip
Rename name -> js_name and release js_name in js_call_as_function
Diffstat (limited to 'src/js.c')
-rw-r--r--src/js.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/js.c b/src/js.c
index 5dd88ac3..15256412 100644
--- a/src/js.c
+++ b/src/js.c
@@ -120,19 +120,19 @@ js_call_as_function(WebKitWebFrame *frame, JSObjectRef obj, char *string, char *
char *ret = NULL;
JSValueRef js_ret, function, v = NULL;
JSObjectRef function_object;
- JSStringRef js_json, name;
+ JSStringRef js_json, js_name;
JSContextRef ctx;
if (obj == NULL)
goto error_out;
ctx = webkit_web_frame_get_global_context(frame);
- name = JSStringCreateWithUTF8CString(string);
+ js_name = JSStringCreateWithUTF8CString(string);
- if (!JSObjectHasProperty(ctx, obj, name)) {
+ if (!JSObjectHasProperty(ctx, obj, js_name)) {
goto error_out;
}
- function = JSObjectGetProperty(ctx, obj, name, NULL);
+ function = JSObjectGetProperty(ctx, obj, js_name, NULL);
function_object = JSValueToObject(ctx, function, NULL);
if (json != NULL) {
js_json = JSStringCreateWithUTF8CString(json);
@@ -150,6 +150,7 @@ js_call_as_function(WebKitWebFrame *frame, JSObjectRef obj, char *string, char *
ret = js_value_to_char(ctx, js_ret);
}
error_out:
+ JSStringRelease(js_name);
if (char_ret != NULL)
*char_ret = ret;
return ret;