diff --git a/ChangeLog b/ChangeLog index 6105c8e..6f54e13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ 0.10 + * Fix file descriptor leak if memory allocation fails in json_util + Zachary Blair, zack_blair at hotmail dot com * Add int64 support. Two new functions json_object_net_int64 and json_object_get_int64. Binary compatibility preserved. Eric Haszlakiewicz, EHASZLA at transunion com diff --git a/json_util.c b/json_util.c index e5a9dc6..203a70f 100644 --- a/json_util.c +++ b/json_util.c @@ -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); }