]> granicus.if.org Git - json-c/commitdiff
Remove superfluous NULL checks
authorAnmol Sarma <me@anmolsarma.in>
Thu, 1 Oct 2015 08:44:03 +0000 (14:14 +0530)
committerAnmol Sarma <me@anmolsarma.in>
Thu, 1 Oct 2015 08:44:03 +0000 (14:14 +0530)
json_tokener.c

index 98611d63c94dbdc1bfcc707e6b9d8187aa0044bb..752a7b394eb6ee3bd71e7d339069e928f0859772 100644 (file)
@@ -131,7 +131,7 @@ void json_tokener_free(struct json_tokener *tok)
 {
   json_tokener_reset(tok);
   if (tok->pb) printbuf_free(tok->pb);
-  if (tok->stack) free(tok->stack);
+  free(tok->stack);
   free(tok);
 }
 
@@ -901,7 +901,7 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
 
 #ifdef HAVE_SETLOCALE
   setlocale(LC_NUMERIC, oldlocale);
-  if (oldlocale) free(oldlocale);
+  free(oldlocale);
 #endif
 
   if (tok->err == json_tokener_success)