diff options
author | ben <ben@rana> | 2016-04-27 08:20:54 -0500 |
---|---|---|
committer | ben <ben@rana> | 2016-04-27 08:20:54 -0500 |
commit | 86e0099835f99de6ccc3bee33a297387993aa037 (patch) | |
tree | 73282ad28e5242e25c44e2c14d2f5e1b767292b6 | |
parent | b8986a889d7e3a445c0265c5cfb3b1db385db756 (diff) | |
parent | d8d47f14b5ed8f6d3f892761ed86c6ce2075c337 (diff) |
merge in master
-rw-r--r-- | sys/src/libjson/json.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/src/libjson/json.c b/sys/src/libjson/json.c index c62cfa248..74fd5eeb0 100644 --- a/sys/src/libjson/json.c +++ b/sys/src/libjson/json.c @@ -323,7 +323,7 @@ jsonparse(char *s) memset(&l, 0, sizeof(l)); l.s = s; l.slen = strlen(s); - if((l.buf = mallocz(l.slen+1, 1)) == nil) + if((l.buf = mallocz(l.slen+UTFmax+1, 1)) == nil) return nil; j = jsonobj(&l); @@ -336,6 +336,8 @@ jsonfree(JSON *j) { JSONEl *e, *f; + if(j == nil) + return; switch(j->t){ case JSONString: if(j->s) |