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

Log the number of bytes that were attempted to be allocated

... in malloc error reporting messages
parent 6abee637
No related branches found
No related tags found
No related merge requests found
......@@ -1224,7 +1224,7 @@ js_get_index(JSContext *cx, uintN argc, jsval *arglist)
if((idx = calloc(total_msgs, sizeof(*idx))) == NULL) {
JS_RESUMEREQUEST(cx, rc);
JS_ReportError(cx, "malloc error on line %d in %s of %s", WHERE);
JS_ReportError(cx, "malloc failure of %u bytes on line %d in %s of %s", total_msgs * sizeof(*idx), WHERE);
return JS_FALSE;
}
......@@ -1899,12 +1899,12 @@ js_get_all_msg_headers(JSContext *cx, uintN argc, jsval *arglist)
if((post = calloc(total_msgs, sizeof(*post))) == NULL) {
JS_RESUMEREQUEST(cx, rc);
JS_ReportError(cx, "malloc error on line %d in %s of %s", WHERE);
JS_ReportError(cx, "malloc failure of %u bytes on line %d in %s of %s", total_msgs * sizeof(*post), WHERE);
return JS_FALSE;
}
if((idx = calloc(total_msgs, sizeof(*idx))) == NULL) {
JS_RESUMEREQUEST(cx, rc);
JS_ReportError(cx, "malloc error on line %d in %s of %s", WHERE);
JS_ReportError(cx, "malloc failure of %u bytes on line %d in %s of %s", total_msgs * sizeof(*idx), WHERE);
free(post);
return JS_FALSE;
}
......
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