]> git.feebdaed.xyz Git - 0xmirror/radare2.git/commitdiff
Fix the last bugs spotted by scan-coverity
authorpancake <pancake@nopcode.org>
Tue, 23 Dec 2025 15:39:09 +0000 (16:39 +0100)
committerpancake <pancake@nopcode.org>
Tue, 23 Dec 2025 15:58:14 +0000 (16:58 +0100)
libr/anal/p/anal_blaze.c
libr/bin/format/mach0/mach0.c
libr/syscall/syscall.c

index e7f61470c0e8a7c7963e78d3a2ad5a5072ff9c96..684c0d1e80e1eac9ead8a8b63d9db6f73d92b443 100644 (file)
@@ -212,7 +212,7 @@ static void mergeBlocks(RList *block_list, HtUP *ht, RList *result) {
                                continue;
                        }
 
-                       if (block->end < UT64_MAX && next_block->start < block->end && next_block->start > block->start) {
+                       if (block->end < UT64_MAX && next_block->start < block->end) {
                                if (next_block->jump == UT64_MAX) {
                                        next_block->jump = block->jump;
                                }
index a3b609bdbbcb98f9e39a7f506563031b5c158d93..8866d496aa48048f1dc79ff3055ecc6556679507 100644 (file)
@@ -4013,6 +4013,8 @@ static bool _load_relocations(struct MACH0_(obj_t) *mo) {
                struct reloc_t **slot = RVecRelocRef_at (threaded_binds, sym_ord);\
                if (slot) {\
                        *slot = reloc;\
+               } else {\
+                       free (reloc);\
                }\
        } else {\
                r_skiplist_insert (mo->relocs_cache, reloc);\
index a899c7f6eabc8dd25c77113386019de04135b2b8..dcb215519790d3c2aa5e812fd76a56c2620ad82f 100644 (file)
@@ -48,13 +48,16 @@ static Sdb *openDatabase(Sdb *db, const char *name) {
                if (r_file_exists (file)) {
                        if (db) {
                                sdb_reset (db);
-                               sdb_open (db, file);
+                               if (sdb_open (db, file) < 0) {
+                                       sdb_free (db);
+                                       db = NULL;
+                               }
                        } else {
                                db = sdb_new (0, file, 0);
                        }
                } else {
                        sdb_free (db);
-                       db = sdb_new0 ();
+                       db = NULL;
                }
                free (file);
        }