Fix variable 'catd' is used uninitialized whenever 'if' condition is false
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
c597721633
commit
c6c1ec81e0
@ -79,14 +79,14 @@ struct catmsg_s
|
|||||||
static nl_catd catmap(FAR const char *path)
|
static nl_catd catmap(FAR const char *path)
|
||||||
{
|
{
|
||||||
FAR const struct cathdr_s *hdr;
|
FAR const struct cathdr_s *hdr;
|
||||||
|
nl_catd catd = MAP_FAILED;
|
||||||
struct stat st;
|
struct stat st;
|
||||||
nl_catd catd;
|
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
fd = open(path, O_RDONLY | O_CLOEXEC);
|
fd = open(path, O_RDONLY | O_CLOEXEC);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
{
|
{
|
||||||
return MAP_FAILED;
|
return catd;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fstat(fd, &st) >= 0)
|
if (fstat(fd, &st) >= 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user