Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* 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
  • Loading branch information...
commit bd0a567673b12dd0c6c2afbb75e85c86dad07dc9 1 parent d34701e
Michael Clark michaeljclark authored
Showing with 3 additions and 0 deletions.
  1. +2 −0  ChangeLog
  2. +1 −0  json_util.c
2  ChangeLog
View
@@ -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
1  json_util.c
View
@@ -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);
}
Please sign in to comment.
Something went wrong with that request. Please try again.