mirror of
https://github.com/u-boot/u-boot.git
synced 2024-11-26 05:34:30 +08:00
sandbox: Fix warnings in cpu.c and os.c
This fixes the following two problems: cppcheck reports: [arch/sandbox/cpu/start.c:132]: (error) Uninitialized variable: err [arch/sandbox/cpu/os.c:371]: (error) Memory leak: fname Signed-off-by: Simon Glass <sjg@chromium.org> Reported-by: Wolfgang Denk <wd@denx.de>
This commit is contained in:
parent
e48f3741c3
commit
f80a8bbee8
@ -367,6 +367,7 @@ int os_dirent_ls(const char *dirname, struct os_dirent_node **headp)
|
||||
|
||||
done:
|
||||
closedir(dir);
|
||||
free(fname);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -130,7 +130,8 @@ static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
|
||||
state->write_ram_buf = true;
|
||||
state->ram_buf_fname = arg;
|
||||
|
||||
if (os_read_ram_buf(arg)) {
|
||||
err = os_read_ram_buf(arg);
|
||||
if (err) {
|
||||
printf("Failed to read RAM buffer\n");
|
||||
return err;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user