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
a0319947
Commit
a0319947
authored
May 07, 2015
by
npzacs
Browse files
Check for failed calloc()
parent
7957233a
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/file/mmc_device_darwin.c
View file @
a0319947
...
...
@@ -399,6 +399,10 @@ MMCDEV *device_open(const char *path)
int
rc
;
dev
=
calloc
(
1
,
sizeof
(
MMCDEV
));
if
(
!
dev
)
{
BD_DEBUG
(
DBG_MKB
|
DBG_CRIT
,
"out of memory
\n
"
);
return
NULL
;
}
rc
=
mmc_open_iokit
(
path
,
dev
);
if
(
0
!=
rc
)
{
...
...
src/file/mmc_device_win32.c
View file @
a0319947
...
...
@@ -161,6 +161,12 @@ MMCDEV *device_open(const char *path)
BD_DEBUG
(
DBG_MMC
,
"Windows MMC drive %s opened
\n
"
,
volume
);
dev
=
calloc
(
1
,
sizeof
(
MMCDEV
));
if
(
!
dev
)
{
BD_DEBUG
(
DBG_MKB
|
DBG_CRIT
,
"out of memory
\n
"
);
CloseHandle
(
fd
);
return
NULL
;
}
dev
->
fd
=
fd
;
return
dev
;
}
...
...
Write
Preview
Markdown
is supported
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