diff options
| author | amelia squires <[email protected]> | 2024-09-16 12:16:29 -0500 |
|---|---|---|
| committer | amelia squires <[email protected]> | 2024-09-16 12:16:29 -0500 |
| commit | 1feb3c40514a7c1726f29502ce37966c308bea79 (patch) | |
| tree | d1a5a26af92af8fabf12d5095a2d3745431593b4 /src/hash/md5.c | |
| parent | dbf438f04dac63f2a32743fded1b7fbf02ed636b (diff) | |
fix _copy and mem leaks
Diffstat (limited to 'src/hash/md5.c')
| -rw-r--r-- | src/hash/md5.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/hash/md5.c b/src/hash/md5.c index 1b3f508..45844f2 100644 --- a/src/hash/md5.c +++ b/src/hash/md5.c @@ -134,7 +134,14 @@ void md5_final(struct md5_hash* hash, char out_stream[64]){ }
-common_hash_clone(md5);
+//common_hash_clone(md5);
+lua_common_hash_clone_oargs(md5, md5, l_md5_init(L), {
+ uint8_t* old = b->buffer;
+ *b = *a;
+ b->buffer = old;
+ memcpy(b->buffer, a->buffer, bs * sizeof * b->buffer);
+});
+
lua_common_hash_init_ni(md5, md5, md5_init_l(L));
lua_common_hash_update(md5, md5);
//common_hash_init_update(md5);
|
