uloop: allow passing 0 as timeout to uloop_run
[project/libubox.git] / jshn.c
diff --git a/jshn.c b/jshn.c
index e2d90220335c6bbc505dd4de4bd26477abb0e752..4989099484be94b8205612a3bbb70983f87c0528 100644 (file)
--- a/jshn.c
+++ b/jshn.c
@@ -338,6 +338,10 @@ int main(int argc, char **argv)
        for (i = 0; environ[i]; i++);
 
        vars = calloc(i, sizeof(*vars));
+       if (!vars) {
+               fprintf(stderr, "%m\n");
+               return -1;
+       }
        for (i = 0; environ[i]; i++) {
                char *c;