Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Joe Martin
OpenLDAP
Commits
d8865931
Commit
d8865931
authored
Jun 05, 2016
by
Hallvard Furuseth
Committed by
Howard Chu
Jun 15, 2016
Browse files
mdb_env_setup_locks: Plug mutexattr leak on error
parent
21ed2bd4
Changes
1
Hide whitespace changes
Inline
Side-by-side
libraries/liblmdb/mdb.c
View file @
d8865931
...
...
@@ -4628,15 +4628,18 @@ mdb_env_setup_locks(MDB_env *env, char *lpath, int mode, int *excl)
memset
(
env
->
me_txns
->
mti_rmutex
,
0
,
sizeof
(
*
env
->
me_txns
->
mti_rmutex
));
memset
(
env
->
me_txns
->
mti_wmutex
,
0
,
sizeof
(
*
env
->
me_txns
->
mti_wmutex
));
if
((
rc
=
pthread_mutexattr_init
(
&
mattr
))
||
(
rc
=
pthread_mutexattr_setpshared
(
&
mattr
,
PTHREAD_PROCESS_SHARED
))
if
((
rc
=
pthread_mutexattr_init
(
&
mattr
)))
goto
fail
;
rc
=
pthread_mutexattr_setpshared
(
&
mattr
,
PTHREAD_PROCESS_SHARED
);
#ifdef MDB_ROBUST_SUPPORTED
||
(
rc
=
pthread_mutexattr_setrobust
(
&
mattr
,
PTHREAD_MUTEX_ROBUST
)
)
if
(
!
rc
)
rc
=
pthread_mutexattr_setrobust
(
&
mattr
,
PTHREAD_MUTEX_ROBUST
)
;
#endif
||
(
rc
=
pthread_mutex_init
(
env
->
me_txns
->
mti_rmutex
,
&
mattr
))
||
(
rc
=
pthread_mutex_init
(
env
->
me_txns
->
mti_wmutex
,
&
mattr
)))
goto
fail
;
if
(
!
rc
)
rc
=
pthread_mutex_init
(
env
->
me_txns
->
mti_rmutex
,
&
mattr
);
if
(
!
rc
)
rc
=
pthread_mutex_init
(
env
->
me_txns
->
mti_wmutex
,
&
mattr
);
pthread_mutexattr_destroy
(
&
mattr
);
if
(
rc
)
goto
fail
;
#endif
/* _WIN32 || MDB_USE_POSIX_SEM */
env
->
me_txns
->
mti_magic
=
MDB_MAGIC
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment