Bug 756610 - Handle OOM in js_CopyErrorObject. r=bhackett

This commit is contained in:
Jan de Mooij 2012-05-30 10:06:49 +02:00
parent f587587628
commit 6a44e7c6e3

View File

@ -1180,6 +1180,8 @@ js_CopyErrorObject(JSContext *cx, HandleObject errobj, HandleObject scope)
if (!proto)
return NULL;
JSObject *copyobj = NewObjectWithGivenProto(cx, &ErrorClass, proto, NULL);
if (!copyobj)
return NULL;
SetExnPrivate(cx, copyobj, copy);
autoFree.p = NULL;
return copyobj;