Fix two memleaks in the vala plugin

This commit is contained in:
pancake 2022-07-01 00:13:19 +02:00
parent bed72b73b2
commit 425f5b248b
2 changed files with 4 additions and 5 deletions

View File

@ -148,16 +148,15 @@ R_IPI const char* r_bin_te_get_arch(struct r_bin_te_obj_t* bin) {
case TE_IMAGE_FILE_MACHINE_POWERPCFP:
return "ppc";
default:
// return "unknown";
return "x86";
}
return "unknown";
}
int r_bin_te_get_bits(struct r_bin_te_obj_t* bin) {
return 32; // It is always 32 bit by now
}
RBinAddr* r_bin_te_get_entrypoint(struct r_bin_te_obj_t* bin) {
RBinAddr *entry = NULL;
@ -176,8 +175,7 @@ RBinAddr* r_bin_te_get_entrypoint(struct r_bin_te_obj_t* bin) {
return entry;
}
ut64 r_bin_te_get_image_base(struct r_bin_te_obj_t* bin)
{
ut64 r_bin_te_get_image_base(struct r_bin_te_obj_t* bin) {
if (bin && bin->header) {
return (ut64)bin->header->ImageBase;
}

View File

@ -70,9 +70,10 @@ static bool lang_vala_file(RLang *lang, const char *file, bool silent) {
if (r_sandbox_system (cmdbuf, 1) != 0) {
free (libname);
free (name);
free (cmdbuf);
return false;
}
free (cmdbuf);
cmdbuf = r_str_newf ("./lib%s." R_LIB_EXT, libname);
free (libname);