Skip to content

Commit

Permalink
Edited src/yajl_tree.c via GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
plaguemorin committed Aug 19, 2011
1 parent e2d0806 commit 48c02bf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/yajl_tree.c
Expand Up @@ -421,6 +421,7 @@ yajl_val yajl_tree_parse (const char *input,

yajl_handle handle;
yajl_status status;
char * internal_err_str;
context_t ctx = { NULL, NULL, NULL, 0 };

ctx.errbuf = error_buffer;
Expand All @@ -438,11 +439,11 @@ yajl_val yajl_tree_parse (const char *input,
status = yajl_complete_parse (handle);
if (status != yajl_status_ok) {
if (error_buffer != NULL && error_buffer_size > 0) {
snprintf(
error_buffer, error_buffer_size, "%s",
(char *) yajl_get_error(handle, 1,
(const unsigned char *) input,
strlen(input)));
internal_err_str = (char *) yajl_get_error(handle, 1,
(const unsigned char *) input,
strlen(input));
snprintf(error_buffer, error_buffer_size, "%s", internal_err_str);
YA_FREE(&(handle->alloc), internal_err_str);
}
yajl_free (handle);
return NULL;
Expand Down

0 comments on commit 48c02bf

Please sign in to comment.