On the off chance the if statement takes the false branch, let's not leak the memory

This commit is contained in:
William King 2013-06-12 16:41:06 -07:00
parent 56f68be4e6
commit 5e5af427ef
1 changed files with 2 additions and 0 deletions

View File

@ -1112,6 +1112,8 @@ JSObject *new_js_dtmf(switch_dtmf_t *dtmf, char *name, JSContext * cx, JSObject
JS_SetPrivate(cx, DTMF, ddtmf);
JS_DefineProperties(cx, DTMF, dtmf_props);
JS_DefineFunctions(cx, DTMF, dtmf_methods);
} else {
free(ddtmf);
}
}
return DTMF;