Check nomem_handler->handler before calling it
This commit is contained in:
1 parent
70807e2b1b
commit
2c3561810d
1 file changed
+1
-1
+1
-1
@@ -111,7 +111,7 @@ static void memory_exhausted() {
|
||||
tsd_init_nomem_handler();
|
||||
|
||||
nomem_handler = pthread_getspecific(nomem_handler_key);
|
||||
if (nomem_handler)
|
||||
if (nomem_handler && nomem_handler->handler)
|
||||
nomem_handler->handler(nomem_handler->data); // Maybe handler() will longjmp() to safety
|
||||
// Or not
|
||||
fprintf(stderr, "jq: error: cannot allocate memory\n");
|
||||
|
||||
Reference in new issue
Block a user