summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-01-31 10:14:14 +0100
committerMichał Górny <mgorny@gentoo.org>2021-01-31 10:16:28 +0100
commit2fe2484bb7f9de72413eb25deb02e4212d81c8d0 (patch)
tree372e217b80423d895fe0a733f3708ddd40f0b8db /net-misc/minidlna/files
parentsys-apps/pkgcore: Bump to 0.11.2 (diff)
downloadgentoo-2fe2484bb7f9de72413eb25deb02e4212d81c8d0.tar.gz
gentoo-2fe2484bb7f9de72413eb25deb02e4212d81c8d0.tar.bz2
gentoo-2fe2484bb7f9de72413eb25deb02e4212d81c8d0.zip
net-misc/minidlna: Fix socket leak
Closes: https://bugs.gentoo.org/768030 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'net-misc/minidlna/files')
-rw-r--r--net-misc/minidlna/files/minidlna-1.3.0-fd-leak.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/net-misc/minidlna/files/minidlna-1.3.0-fd-leak.patch b/net-misc/minidlna/files/minidlna-1.3.0-fd-leak.patch
new file mode 100644
index 000000000000..eec2bcd020e7
--- /dev/null
+++ b/net-misc/minidlna/files/minidlna-1.3.0-fd-leak.patch
@@ -0,0 +1,28 @@
+diff --git a/upnpevents.c b/upnpevents.c
+index 4de6ce8..1126fa7 100644
+--- a/upnpevents.c
++++ b/upnpevents.c
+@@ -290,18 +290,17 @@ upnp_event_create_notify(struct subscriber *sub)
+ addr.sin_family = AF_INET;
+ inet_aton(obj->addrstr, &addr.sin_addr);
+ addr.sin_port = htons(port);
+- DPRINTF(E_DEBUG, L_HTTP, "%s: '%s' %hu '%s'\n", "upnp_event_notify_connect",
++ DPRINTF(E_DEBUG, L_HTTP, "%s: '%s' %hu '%s'\n", "upnp_event_create_notify",
+ obj->addrstr, port, obj->path);
+ obj->state = EConnecting;
++ obj->ev = (struct event ){ .fd = s, .rdwr = EVENT_WRITE,
++ .process = upnp_event_process_notify, .data = obj };
++ event_module.add(&obj->ev);
+ if(connect(s, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+ if(errno != EINPROGRESS && errno != EWOULDBLOCK) {
+- DPRINTF(E_ERROR, L_HTTP, "%s: connect(): %s\n", "upnp_event_notify_connect", strerror(errno));
++ DPRINTF(E_ERROR, L_HTTP, "%s: connect(): %s\n", "upnp_event_create_notify", strerror(errno));
+ obj->state = EError;
+ }
+- } else {
+- obj->ev = (struct event ){ .fd = s, .rdwr = EVENT_WRITE,
+- .process = upnp_event_process_notify, .data = obj };
+- event_module.add(&obj->ev);
+ }
+
+ return;