Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
HAMANO Tsukasa
OpenLDAP
Commits
819d9816
Commit
819d9816
authored
Aug 11, 2011
by
Howard Chu
Browse files
Valgrind complaints
parent
01c2f781
Changes
2
Hide whitespace changes
Inline
Side-by-side
libraries/libmdb/Makefile
View file @
819d9816
...
...
@@ -4,7 +4,7 @@ OPT = -O2 -g
CFLAGS
=
-pthread
$(OPT)
$(W)
$(XCFLAGS)
LDLIBS
=
all
:
m
test m
db_stat
all
:
mdb_stat
mtest mtest2
clean
:
rm
-rf
mtest mdb_stat
*
.[ao]
*
~ testdb
...
...
libraries/libmdb/mdb.c
View file @
819d9816
...
...
@@ -1299,6 +1299,8 @@ fail:
}
#define LOCKNAME "/lock.mdb"
#define DATANAME "/data.mdb"
int
mdbenv_open
(
MDB_env
*
env
,
const
char
*
path
,
unsigned
int
flags
,
mode_t
mode
)
{
...
...
@@ -1306,12 +1308,12 @@ mdbenv_open(MDB_env *env, const char *path, unsigned int flags, mode_t mode)
char
*
lpath
,
*
dpath
;
len
=
strlen
(
path
);
lpath
=
malloc
(
len
+
sizeof
(
"/lock.mdb"
)
+
len
+
sizeof
(
"/data.db"
));
lpath
=
malloc
(
len
+
sizeof
(
LOCKNAME
)
+
len
+
sizeof
(
DATANAME
));
if
(
!
lpath
)
return
ENOMEM
;
dpath
=
lpath
+
len
+
sizeof
(
"/lock.mdb"
);
sprintf
(
lpath
,
"%s
/lock.mdb"
,
path
);
sprintf
(
dpath
,
"%s
/data.mdb"
,
path
);
dpath
=
lpath
+
len
+
sizeof
(
LOCKNAME
);
sprintf
(
lpath
,
"%s
"
LOCKNAME
,
path
);
sprintf
(
dpath
,
"%s
"
DATANAME
,
path
);
rc
=
mdbenv_setup_locks
(
env
,
lpath
,
mode
,
&
excl
);
if
(
rc
)
...
...
@@ -1351,6 +1353,8 @@ mdbenv_close(MDB_env *env)
if
(
env
==
NULL
)
return
;
free
(
env
->
me_dbs
[
1
]);
free
(
env
->
me_dbs
[
0
]);
free
(
env
->
me_dbxs
);
free
(
env
->
me_path
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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