FreeBSD Bugzilla – Attachment 222869 Details for
Bug 203097
[libgeom] multiple geom_stats_open/close() leaks memory
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Don't leak memory in geom_stats_resync
geom_stats_leak.diff (text/plain), 587 bytes, created by
Alan Somers
on 2021-02-27 22:48:37 UTC
(
hide
)
Description:
Don't leak memory in geom_stats_resync
Filename:
MIME Type:
Creator:
Alan Somers
Created:
2021-02-27 22:48:37 UTC
Size:
587 bytes
patch
obsolete
>diff --git a/lib/libgeom/geom_stats.c b/lib/libgeom/geom_stats.c >index ebf7868c3c65..cba61f5e7b96 100644 >--- a/lib/libgeom/geom_stats.c >+++ b/lib/libgeom/geom_stats.c >@@ -67,11 +67,15 @@ geom_stats_resync(void) > if (statsfd == -1) > return; > for (;;) { >+ munmap(statp, npages *pagesize); > p = mmap(statp, (npages + 1) * pagesize, > PROT_READ, MAP_SHARED, statsfd, 0); >- if (p == MAP_FAILED) >+ if (p == MAP_FAILED) { >+ npages--; >+ p = mmap(statp, npages * pagesize, >+ PROT_READ, MAP_SHARED, statsfd, 0); > break; >- else >+ } else > statp = p; > npages++; > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 203097
: 222869