Fix all memory leaks
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <stdbool.h> // bool
|
||||
|
||||
#define OBJ_SIZE 64
|
||||
#define OBJ_SIZE 32
|
||||
|
||||
typedef struct obj_entry {
|
||||
char const* key;
|
||||
@@ -25,7 +25,7 @@ struct json_value {
|
||||
enum json_type type;
|
||||
union {
|
||||
obj_t* object;
|
||||
struct json_value** array;
|
||||
struct json_value** array; // we need an array of pointers to allow null termination
|
||||
char* string;
|
||||
bool boolean;
|
||||
double number;
|
||||
@@ -34,8 +34,10 @@ struct json_value {
|
||||
|
||||
void* obj_at(obj_t m, char* const key);
|
||||
bool obj_insert(obj_t m, char* const key, struct json_value* value);
|
||||
void obj_delete(obj_t m);
|
||||
void obj_delete(obj_t* m);
|
||||
|
||||
void print_json(struct json_value val, int indent);
|
||||
|
||||
void json_value_delete(struct json_value val);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user