aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2010-12-11 00:05:52 +0100
committerSamuel Ortiz <sameo@linux.intel.com>2010-12-11 00:10:29 +0100
commit94c1802529dba1a27a10cc2fddfa85f95eb5431e (patch)
tree1899120fc2f979897f9bfee99feafab11deadf06
parent8beab5bcc4048158791427021a3cc3b3bb9c88f7 (diff)
downloadpacrunner-94c1802529dba1a27a10cc2fddfa85f95eb5431e.tar.gz
mozjs: Return an allocated string or NULL
Getting back to the original and fixed code, from commit e4c11a9b.
-rw-r--r--plugins/mozjs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mozjs.c b/plugins/mozjs.c
index f717ff2..c2ab761 100644
--- a/plugins/mozjs.c
+++ b/plugins/mozjs.c
@@ -220,7 +220,7 @@ static char * mozjs_execute(const char *url, const char *host)
DBG("url %s host %s", url, host);
if (jsctx == NULL)
- return "DIRECT";
+ return NULL;
tmpurl = JS_strdup(jsctx, url);
tmphost = JS_strdup(jsctx, host);
@@ -250,7 +250,7 @@ static char * mozjs_execute(const char *url, const char *host)
if (result) {
answer = JS_GetStringBytes(JS_ValueToString(jsctx, rval));
- return answer;
+ return g_strdup(answer);
}
return NULL;