json_load_file: Initialize the error struct properly
[jansson.git] / src / load.c
index f004525..53241ff 100644 (file)
@@ -864,6 +864,8 @@ json_t *json_load_file(const char *path, json_error_t *error)
     json_t *result;
     FILE *fp;
 
+    error_init(error);
+
     fp = fopen(path, "r");
     if(!fp)
     {