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
Jean-Baptiste Kempf
libaacs
Commits
8b9be956
Commit
8b9be956
authored
May 06, 2015
by
npzacs
Browse files
Fix leak
parent
1f1cb7bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/file/mmc_device_linux.c
View file @
8b9be956
...
...
@@ -115,7 +115,6 @@ MMCDEV *device_open(const char *path)
size_t
path_len
;
struct
stat
st
;
int
fd
=
-
1
;
MMCDEV
*
dev
=
NULL
;
/* resolve path */
if
(
!
aacs_resolve_path
(
path
,
resolved_path
))
{
...
...
@@ -134,8 +133,6 @@ MMCDEV *device_open(const char *path)
return
NULL
;
}
dev
=
calloc
(
1
,
sizeof
(
MMCDEV
));
if
(
S_ISBLK
(
st
.
st_mode
))
{
/* opening device */
BD_DEBUG
(
DBG_MMC
,
"Opening block device %s
\n
"
,
resolved_path
);
...
...
@@ -185,10 +182,14 @@ MMCDEV *device_open(const char *path)
#endif
if
(
fd
>=
0
)
{
dev
=
calloc
(
1
,
sizeof
(
MMCDEV
));
dev
->
fd
=
fd
;
MMCDEV
*
dev
=
calloc
(
1
,
sizeof
(
MMCDEV
));
if
(
dev
)
{
dev
->
fd
=
fd
;
return
dev
;
}
}
return
dev
;
return
NULL
;
}
void
device_close
(
MMCDEV
**
pp
)
...
...
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