mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-14 17:48:28 +00:00
bin_sfc.c: fix NULL dereference when R_NEW0 fails (#7548)
* bin_sfc.c: fix NULL dereference when R_NEW0 fails * Update bin_sfc.c
This commit is contained in:
parent
ce99a1123c
commit
5fa1013a4f
@ -175,6 +175,7 @@ static RList* sections(RBinFile *arch) {
|
||||
static RList *mem (RBinFile *arch) {
|
||||
RList *ret;
|
||||
RBinMem *m;
|
||||
RBinMem *m_bak;
|
||||
if (!(ret = r_list_new())) {
|
||||
return NULL;
|
||||
}
|
||||
@ -198,8 +199,9 @@ static RList *mem (RBinFile *arch) {
|
||||
m->size = LOWRAM_MIRROR_SIZE;
|
||||
m->perms = r_str_rwx ("rwx");
|
||||
r_list_append (m->mirrors, m);
|
||||
m_bak = m;
|
||||
if (!(m = R_NEW0 (RBinMem))) {
|
||||
r_list_free (m->mirrors);
|
||||
r_list_free (m_bak->mirrors);
|
||||
return ret;
|
||||
}
|
||||
m->name = strdup ("HIRAM");
|
||||
|
Loading…
x
Reference in New Issue
Block a user