Skip to content
Snippets Groups Projects
Commit 35666fb0 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix CID 479078: Resource leak (RESOURCE_LEAK)

Passing an unparseable integer to console.editfile() could leak heap memory
parent ec3f6c0d
No related branches found
No related tags found
1 merge request!455Update branch with changes from master
Pipeline #6272 failed
......@@ -1635,8 +1635,10 @@ js_editfile(JSContext *cx, uintN argc, jsval *arglist)
for (uintN i = 0; i < argc; ++i) {
if(JSVAL_IS_NUMBER(argv[i])) {
if(!JS_ValueToInt32(cx, argv[i], &maxlines))
return JS_FALSE;
if(!JS_ValueToInt32(cx, argv[i], &maxlines)) {
result = JS_FALSE;
break;
}
continue;
}
if(JSVAL_IS_STRING(argv[i])) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment