mirror of
https://github.com/json-c/json-c.git
synced 2026-04-01 03:19:06 +08:00
* Fix file descriptor leak if memory allocation fails in json_util
Zachary Blair, zack_blair at hotmail dot com git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@58 327403b1-1117-474d-bef2-5cb71233fd97
This commit is contained in:
@@ -67,6 +67,7 @@ struct json_object* json_object_from_file(const char *filename)
|
||||
return (struct json_object*)error_ptr(-1);
|
||||
}
|
||||
if(!(pb = printbuf_new())) {
|
||||
close(fd);
|
||||
MC_ERROR("json_object_from_file: printbuf_new failed\n");
|
||||
return (struct json_object*)error_ptr(-1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user