Commit 9d913b65 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov

sockets: Fix freeing dgram sockets data

Otherwise use-after-free error happens.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
parent c2353b30
...@@ -705,16 +705,18 @@ static int run_connect_jobs_dgram(void) ...@@ -705,16 +705,18 @@ static int run_connect_jobs_dgram(void)
* Free data we don't need anymore. * Free data we don't need anymore.
*/ */
for (d = dgram_peer; d;) { for (d = dgram_peer; d;) {
struct unix_dgram_peer *h = d;
d = d->next; d = d->next;
xfree(d); xfree(h);
} }
for (i = 0; i < SK_HASH_SIZE; i++) { for (i = 0; i < SK_HASH_SIZE; i++) {
if (!dgram_bound[i]) if (!dgram_bound[i])
continue; continue;
for (b = dgram_bound[i]; b;) { for (b = dgram_bound[i]; b;) {
struct unix_dgram_bound *h = b;
b = b->next; b = b->next;
xfree(b); xfree(h);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment