FreeBSD Bugzilla – Attachment 248174 Details for
Bug 276818
[libc] mtx_init memory leak
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
fix a memory leak
0001-fix-a-memory-leak.patch (text/plain), 822 bytes, created by
Hodong
on 2024-02-04 11:00:47 UTC
(
hide
)
Description:
fix a memory leak
Filename:
MIME Type:
Creator:
Hodong
Created:
2024-02-04 11:00:47 UTC
Size:
822 bytes
patch
obsolete
>From 6f60a0b3c89613886aa6a958bac9b10cd368d9ba Mon Sep 17 00:00:00 2001 >From: Hodong Kim <hodong@nimfsoft.art> >Date: Sun, 4 Feb 2024 19:58:19 +0900 >Subject: [PATCH] fix a memory leak > >--- > mtx.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/mtx.c b/mtx.c >index 719ba64..15a25d7 100644 >--- a/mtx.c >+++ b/mtx.c >@@ -60,10 +60,15 @@ mtx_init(mtx_t *mtx, int type) > > if (pthread_mutexattr_init(&attr) != 0) > return (thrd_error); >- if (pthread_mutexattr_settype(&attr, mt) != 0) >- return (thrd_error); >- if (pthread_mutex_init(mtx, &attr) != 0) >+ >+ if (pthread_mutexattr_settype(&attr, mt) != 0 || >+ pthread_mutex_init(mtx, &attr) != 0) >+ { >+ pthread_mutexattr_destroy(&attr); > return (thrd_error); >+ } >+ >+ pthread_mutexattr_destroy(&attr); > return (thrd_success); > } > >-- >2.43.0 >
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 276818
:
248171
| 248174