Skip to content

Commit

Permalink
Fix #21705 - check r_io_plugin_add return value and freed unused allo…
Browse files Browse the repository at this point in the history
…cated memory ##io
  • Loading branch information
Hripsimee authored and as0ler committed May 30, 2023
1 parent 240660f commit 5450898
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libr/io/io_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ R_API bool r_io_plugin_init(RIO *io) {
return false;
}
memcpy (static_plugin, io_static_plugins[i], sizeof (RIOPlugin));
r_io_plugin_add (io, static_plugin);
if (!r_io_plugin_add (io, static_plugin)) {
free (static_plugin);
return false;
}
}
return true;
}
Expand Down

0 comments on commit 5450898

Please sign in to comment.