diff --git a/libr/bin/format/elf/elf.c b/libr/bin/format/elf/elf.c index 8208481d4a..7f3a1980a4 100644 --- a/libr/bin/format/elf/elf.c +++ b/libr/bin/format/elf/elf.c @@ -1137,7 +1137,7 @@ struct r_bin_elf_reloc_t* Elf_(r_bin_elf_get_relocs)(struct Elf_(r_bin_elf_obj_t struct r_bin_elf_lib_t* Elf_(r_bin_elf_get_libs)(struct Elf_(r_bin_elf_obj_t) *bin) { struct r_bin_elf_lib_t *ret = NULL; - int i, j, k; + int j, k; if (!bin || !bin->phdr || !bin->dyn_buf) return NULL; @@ -1244,7 +1244,7 @@ static struct r_bin_elf_symbol_t* get_symbols_from_phdr (struct Elf_(r_bin_elf_o Elf_(Sym) *sym = NULL; Elf_(Addr) addr_sym_table = 0; struct r_bin_elf_symbol_t *ret = NULL; - int i, j, k, r, tsize, len, nsym, ret_ctr; + int j, k, r, tsize, len, nsym, ret_ctr; ut64 toffset; if (!bin || !bin->phdr || bin->ehdr.e_phnum == 0) diff --git a/libr/core/syscmd.c b/libr/core/syscmd.c index f34db9c461..b59f572c5a 100644 --- a/libr/core/syscmd.c +++ b/libr/core/syscmd.c @@ -112,14 +112,14 @@ R_API void r_core_syscmd_ls(const char *input) { if (*path == '~') { homepath = r_str_home (path+2); - path = (const char *)homepath; + if (homepath) path = (const char *)homepath; } else if (*path == '$'){ if (!strncmp (path+1, "home", 4) || !strncmp (path+1, "HOME", 4)){ if (!*(path+6)) homepath = r_str_home (NULL); else homepath = r_str_home (path+6); - path = (const char *)homepath; + if (homepath) path = (const char *)homepath; } } @@ -163,8 +163,8 @@ R_API void r_core_syscmd_ls(const char *input) { } if (printfmt == FMT_JSON) r_cons_printf ("]"); free (dir); - if (d) free (d); - if (homepath) free (homepath); + free (d); + free (homepath); free (pattern); r_list_free (files); } diff --git a/shlr/java/dsojson.c b/shlr/java/dsojson.c index 6e467315fb..aee234f3a8 100644 --- a/shlr/java/dsojson.c +++ b/shlr/java/dsojson.c @@ -583,6 +583,7 @@ R_API int dso_json_dict_insert_num_key_obj (DsoJsonObj *dict, int key, DsoJsonOb int res = dso_json_dict_insert_key_obj (dict, key_obj, val_obj); if (!res) { dso_json_obj_del (key_obj); + dso_json_obj_del (val_obj); } return res; } @@ -627,7 +628,6 @@ R_API int dso_json_dict_insert_key_obj (DsoJsonObj *dict, DsoJsonObj *key, DsoJs r_list_append (the_list, entry); res = R_TRUE; } - free (value); return res; }