diff options
| author | 2025-02-04 12:39:46 +0000 | |
|---|---|---|
| committer | 2025-02-04 12:39:46 +0000 | |
| commit | 9afcb98d2223dc168010407f79e959dca1985767 (patch) | |
| tree | c67dcf42a7786f7480ed16457abb57ff207509d2 | |
| parent | Merge branch 'master' of comam.es:git/snac2 (diff) | |
| parent | Fix memory leaks (diff) | |
| download | penes-snac2-9afcb98d2223dc168010407f79e959dca1985767.tar.gz penes-snac2-9afcb98d2223dc168010407f79e959dca1985767.tar.xz penes-snac2-9afcb98d2223dc168010407f79e959dca1985767.zip | |
Merge pull request 'Fix memory leaks' (#294) from inz/snac2:memory-leak into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/294
| -rw-r--r-- | xs_openssl.h | 2 | ||||
| -rw-r--r-- | xs_socket.h | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/xs_openssl.h b/xs_openssl.h index 9388691..f215bcc 100644 --- a/xs_openssl.h +++ b/xs_openssl.h | |||
| @@ -83,7 +83,7 @@ xs_val *xs_base64_dec(const xs_str *data, int *size) | |||
| 83 | s = xs_realloc(s, _xs_blk_size(*size + 1)); | 83 | s = xs_realloc(s, _xs_blk_size(*size + 1)); |
| 84 | s[*size] = '\0'; | 84 | s[*size] = '\0'; |
| 85 | 85 | ||
| 86 | BIO_free_all(mem); | 86 | BIO_free_all(b64); |
| 87 | 87 | ||
| 88 | return s; | 88 | return s; |
| 89 | } | 89 | } |
diff --git a/xs_socket.h b/xs_socket.h index 6e618ba..7bf5298 100644 --- a/xs_socket.h +++ b/xs_socket.h | |||
| @@ -85,6 +85,8 @@ int xs_socket_server(const char *addr, const char *serv) | |||
| 85 | listen(rs, SOMAXCONN); | 85 | listen(rs, SOMAXCONN); |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | freeaddrinfo(res); | ||
| 89 | |||
| 88 | #else /* WITHOUT_GETADDRINFO */ | 90 | #else /* WITHOUT_GETADDRINFO */ |
| 89 | struct sockaddr_in host; | 91 | struct sockaddr_in host; |
| 90 | 92 | ||