1- /* radare - LGPL3 - Copyright 2016-2023 - c0riolis, x0urc3 */
1+ /* radare - LGPL3 - Copyright 2016-2025 - c0riolis, x0urc3 */
22
33#include <r_bin.h>
44#include "../format/pyc/pyc.h"
@@ -28,9 +28,6 @@ static bool load(RBinFile *bf, RBuffer *buf, ut64 loadaddr) {
2828 ut32 m ;
2929 r_buf_read_at (buf , 0 , (ut8 * )& m , sizeof (m ));
3030 RBinPycObj * obj = R_NEW0 (RBinPycObj );
31- if (!obj ) {
32- return false;
33- }
3431 obj -> version = get_pyc_version (m );
3532 bf -> bo -> bin_obj = obj ;
3633 return true;
@@ -59,9 +56,6 @@ static ut64 get_entrypoint(RBuffer *buf, ut32 magic, ut64 *out_code_start_offset
5956static RBinInfo * info (RBinFile * arch ) {
6057 RBinPycObj * obj = arch && arch -> bo ? (RBinPycObj * )arch -> bo -> bin_obj : NULL ;
6158 RBinInfo * ret = R_NEW0 (RBinInfo );
62- if (!ret ) {
63- return NULL ;
64- }
6559 ret -> file = strdup (arch -> file );
6660 ret -> type = r_str_newf ("Python %s byte-compiled file" , obj ? obj -> version .version : "" );
6761 ret -> bclass = strdup ("Python byte-compiled file" );
@@ -87,10 +81,6 @@ static RList *entries(RBinFile *arch) {
8781 return NULL ;
8882 }
8983 RBinAddr * addr = R_NEW0 (RBinAddr );
90- if (!addr ) {
91- r_list_free (entries );
92- return NULL ;
93- }
9484 ut64 entrypoint = get_entrypoint (arch -> buf , obj ? obj -> version .magic : 0 , obj ? & obj -> code_start_offset : NULL );
9585 addr -> paddr = entrypoint ;
9686 addr -> vaddr = entrypoint ;
@@ -148,10 +138,9 @@ static void destroy(RBinFile *bf) {
148138 if (!obj ) {
149139 return ;
150140 }
151- // Follow previous ownership semantics: interned_table and cobjs contained heap items
152141 r_list_free (obj -> interned_table );
153142 r_list_free (obj -> cobjs );
154- r_list_free (obj -> sections_cache );
143+ // Causes Double free : r_list_free (obj->sections_cache);
155144 free (obj );
156145 bf -> bo -> bin_obj = NULL ;
157146}
0 commit comments