libmowgli: fix memory leak
This commit is contained in:
parent
8df6525b74
commit
7b980e56b2
2 changed files with 30 additions and 2 deletions
28
srcpkgs/libmowgli/patches/fix-memory-leak.patch
Normal file
28
srcpkgs/libmowgli/patches/fix-memory-leak.patch
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
From 21658b28f1323f11f1aac936b39fb41502c17b8a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aaron Jones <aaronmdjones@gmail.com>
|
||||||
|
Date: Tue, 6 Mar 2018 19:51:04 +0000
|
||||||
|
Subject: [PATCH] src/libmowgli/dns/evloop_res.c: fix memory leak
|
||||||
|
|
||||||
|
mowgli_dns_evloop_init() [called by mowgli_dns_create()] allocates
|
||||||
|
a random number generator and assigns it to `dns->state->rand', but
|
||||||
|
mowgli_dns_evloop_destroy() [called by mowgli_dns_destroy()] does
|
||||||
|
not free this object.
|
||||||
|
|
||||||
|
This was found while running Atheme IRC Services (atheme/#621) under
|
||||||
|
Valgrind.
|
||||||
|
---
|
||||||
|
src/libmowgli/dns/evloop_res.c | 1 +
|
||||||
|
1 file changed, 1 insertion(+)
|
||||||
|
|
||||||
|
diff --git a/src/libmowgli/dns/evloop_res.c b/src/libmowgli/dns/evloop_res.c
|
||||||
|
index c8c7775..88757aa 100644
|
||||||
|
--- src/libmowgli/dns/evloop_res.c
|
||||||
|
+++ src/libmowgli/dns/evloop_res.c
|
||||||
|
@@ -194,6 +194,7 @@ mowgli_dns_evloop_destroy(mowgli_dns_t *dns)
|
||||||
|
|
||||||
|
mowgli_timer_destroy(state->eventloop, state->timeout_resolver_timer);
|
||||||
|
|
||||||
|
+ mowgli_object_unref(state->rand);
|
||||||
|
mowgli_free(state);
|
||||||
|
dns->dns_state = NULL;
|
||||||
|
}
|
|
@ -1,15 +1,15 @@
|
||||||
# Template file for 'libmowgli'
|
# Template file for 'libmowgli'
|
||||||
pkgname=libmowgli
|
pkgname=libmowgli
|
||||||
version=2.1.3
|
version=2.1.3
|
||||||
revision=4
|
revision=5
|
||||||
wrksrc="${pkgname}-2-${version}"
|
wrksrc="${pkgname}-2-${version}"
|
||||||
build_style=gnu-configure
|
build_style=gnu-configure
|
||||||
hostmakedepends="pkg-config"
|
hostmakedepends="pkg-config"
|
||||||
makedepends="libressl-devel"
|
makedepends="libressl-devel"
|
||||||
short_desc="Performance and usability-oriented extensions to C"
|
short_desc="Performance and usability-oriented extensions to C"
|
||||||
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
maintainer="Juan RP <xtraeme@voidlinux.eu>"
|
||||||
homepage="https://github.com/atheme/libmowgli-2"
|
|
||||||
license="MIT"
|
license="MIT"
|
||||||
|
homepage="https://github.com/atheme/libmowgli-2"
|
||||||
distfiles="https://github.com/atheme/libmowgli-2/archive/v${version}.tar.gz"
|
distfiles="https://github.com/atheme/libmowgli-2/archive/v${version}.tar.gz"
|
||||||
checksum=b7faab2fb9f46366a52b51443054a2ed4ecdd04774c65754bf807c5e9bdda477
|
checksum=b7faab2fb9f46366a52b51443054a2ed4ecdd04774c65754bf807c5e9bdda477
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue