Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Commit

Permalink
memory leak in json
Browse files Browse the repository at this point in the history
add reffjson and add function close_json
  • Loading branch information
h4child committed Feb 23, 2018
1 parent 6c2fae5 commit fb258de
Show file tree
Hide file tree
Showing 8 changed files with 237 additions and 211 deletions.
2 changes: 1 addition & 1 deletion include/framebot/framebot.h
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ typedef int bool;

void framebot_init();
Bot * framebot(const char *token);
json_t *generic_method_call (const char *token, char *formats, ...);
refjson *generic_method_call (const char *token, char *formats, ...);
Error * show_error();

/** Available methods **/
Expand Down
10 changes: 8 additions & 2 deletions include/framebot/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@

#include <framebot/framebot.h>

json_t * start_json(char * json);
typedef struct _struct_json {
json_t *root;
json_t *content;
} refjson;

refjson * start_json(char * json);
void close_json( refjson *s_json );
void error_parse(json_t * error);
json_t * load(char * json);
refjson * load(char * json);
User * user_parse(json_t * json);
Chat * chat_parse(json_t *json);
MessageEntity * message_entity_parse(json_t *json);
Expand Down

0 comments on commit fb258de

Please sign in to comment.