Skip to content

Commit 6cdb4a7

Browse files
authored
Fix memory leak. (#54)
Signed-off-by: John Plevyak <[email protected]>
1 parent 91dc647 commit 6cdb4a7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

proxy_wasm_api.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,9 @@ inline WasmResult setHeaderMapPairs(WasmHeaderMapType type, const HeaderStringPa
706706
const char *ptr = nullptr;
707707
size_t size = 0;
708708
exportPairs(pairs, &ptr, &size);
709-
return proxy_set_header_map_pairs(type, ptr, size);
709+
auto result = proxy_set_header_map_pairs(type, ptr, size);
710+
::free(const_cast<char *>(ptr));
711+
return result;
710712
}
711713

712714
inline WasmResult getHeaderMapSize(WasmHeaderMapType type, size_t *size) {

0 commit comments

Comments
 (0)