Skip to content

Commit d168d1a

Browse files
authored
fix: some issues detected by linter (#96)
1 parent b653946 commit d168d1a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/http/ngx_http_wasm_api.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,10 @@ proxy_get_configuration(int32_t addr, int32_t size_addr)
632632

633633
log = ngx_http_wasm_get_log();
634634
conf = ngx_http_wasm_get_conf();
635+
if (conf == NULL) {
636+
return PROXY_RESULT_NOT_FOUND;
637+
}
638+
635639
data = conf->data;
636640
len = conf->len;
637641

@@ -1422,7 +1426,7 @@ proxy_http_call(int32_t up_data, int32_t up_size,
14221426
ngx_log_t *log;
14231427
ngx_url_t url;
14241428

1425-
r = ngx_http_wasm_get_req();
1429+
must_get_req(r);
14261430
log = r->connection->log;
14271431

14281432
if (!ngx_http_wasm_is_yieldable(r)) {

src/vm/wasmtime.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ ngx_wasm_wasmtime_load(const char *bytecode, size_t size)
140140
wasmtime_extern_t item;
141141

142142
error = wasmtime_module_new(vm_engine, (const uint8_t*) bytecode, size, &module);
143-
if (module == NULL) {
143+
if (error != NULL) {
144+
ngx_wasm_wasmtime_report_error(ngx_cycle->log, "failed to new module: ", error, NULL);
144145
return NULL;
145146
}
146147

0 commit comments

Comments
 (0)