From: Dmitry Volyntsev Date: Tue, 27 Feb 2018 11:10:36 +0000 (+0300) Subject: Fixed memory leak in CLI. X-Git-Tag: 0.2.0~32 X-Git-Url: http://www.kaiwu.me/postgresql/commit/?a=commitdiff_plain;h=ab85751978d69ab29316954585898f8030424cb4;p=njs.git Fixed memory leak in CLI. --- diff --git a/njs/njs.c b/njs/njs.c index c4bdb1ca..4ce9e093 100644 --- a/njs/njs.c +++ b/njs/njs.c @@ -253,6 +253,7 @@ njs_interactive_shell(njs_opts_t *opts, njs_vm_opt_t *vm_options) } if (njs_externals_init(vm) != NXT_OK) { + fprintf(stderr, "failed to add external protos\n"); return NXT_ERROR; } @@ -389,8 +390,11 @@ njs_process_file(njs_opts_t *opts, njs_vm_opt_t *vm_options) goto done; } - if (njs_externals_init(vm) != NXT_OK) { - return NXT_ERROR; + ret = njs_externals_init(vm); + if (ret != NXT_OK) { + fprintf(stderr, "failed to add external protos\n"); + ret = NXT_ERROR; + goto done; } ret = njs_process_script(vm, opts, &script, &out);