FreeBSD Bugzilla – Attachment 248171 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), 894 bytes, created by
Hodong
on 2024-02-04 10:09:11 UTC
(
hide
)
Description:
fix a memory leak
Filename:
MIME Type:
Creator:
Hodong
Created:
2024-02-04 10:09:11 UTC
Size:
894 bytes
patch
obsolete
>From 81555bc2299f5ba692413e18cd45d9a2e77f9d94 Mon Sep 17 00:00:00 2001 >From: Hodong Kim <hodong@nimfsoft.art> >Date: Sun, 4 Feb 2024 19:01:00 +0900 >Subject: [PATCH] fix a memory leak > >--- > mtx.c | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > >diff --git a/mtx.c b/mtx.c >index 719ba64..52377e4 100644 >--- a/mtx.c >+++ b/mtx.c >@@ -58,12 +58,15 @@ mtx_init(mtx_t *mtx, int type) > return (thrd_error); > } > >- 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_init(&attr) != 0 || >+ 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