Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infer fixes - round 2 #4993

Merged
merged 1 commit into from May 24, 2016
Merged

Infer fixes - round 2 #4993

merged 1 commit into from May 24, 2016

Conversation

Svenito
Copy link
Contributor

@Svenito Svenito commented May 24, 2016

This series of commits bring the infer result to

MEMORY_LEAK: 132
NULL_DEREFERENCE: 49
RESOURCE_LEAK: 4

The memory leaks are down to things being added to a list, causing false positives.

I haven't fully worked through shlr and some other files where I wasn't entirely sure how to handle the errors.

@radare
Copy link
Collaborator

radare commented May 24, 2016

please squash

@radare
Copy link
Collaborator

radare commented May 24, 2016

if you fix stuff in sdb do it in the original repo , not here

@Svenito
Copy link
Contributor Author

Svenito commented May 24, 2016

Ok... shall I unstage all shlr commits in that case?

@radare
Copy link
Collaborator

radare commented May 24, 2016

only sdb and capstone, the other ones are not living outside

@@ -153,9 +153,12 @@ R_API ut8 *r_crypto_get_output(RCrypto *cry, int *size) {
memcpy (buf, cry->output, *size);
} else {
/* initialize */
const int size = 4096;
cry->output = realloc(buf, size);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing space

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if realloc fails it will leak buf

@radare
Copy link
Collaborator

radare commented May 24, 2016

fully reviewed. please address those comments and i'll merge

@@ -167,8 +167,8 @@ static int r_debug_bf_kill(RDebug *dbg, int pid, int tid, int sig) {
static RList *r_debug_native_map_get(RDebug *dbg) {
RIOBdescbg *o = dbg->iob.io->desc->data;
BfvmCPU *c = o->bfvm;
RList *list = r_list_new ();
list->free = (RListFree)r_debug_map_free;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r_debug_map_free is better than just plain free

R_API void r_debug_map_free(RDebugMap *map) {
    free (map->name);
    free (map);
}

@radare
Copy link
Collaborator

radare commented May 24, 2016

ping

Squashed: Fix PR issues
Squashed: More PR Fixes
@radare radare merged commit 547f8bb into radareorg:master May 24, 2016
@Svenito Svenito deleted the infer-fixes-2 branch May 25, 2016 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants