Closed hausdorf closed 13 years ago
It should be getting malloc'd through load file, hence why we pass it a double pointer.
I can take a look at it in a bit.
@kyeana, take your time. Filed a bug report so that we could get around to it when we want to.
You can see what the bug looks like for us here
Awesome sauce
What's really happening here is that the call to load_file()
in this line fails at some point. Since it never gets malloc'd, freeing it causes an error.
Problem was char *buffer1; initializes buffer1 to garbage, not to null, thus the if(buffer1) returns true and we try to free stuff we never malloc'd.
Fix in my branch.
Did you push that to the server, @kyeana? The comments in, for example, in git_diff_no_index, there are still comments referencing #15, and yes, I've pulled from master very recently.
OK, I found your fix, you just didn't remove the comments.
PROBLEM: A call to
git_diff_no_index()
will allocate the contents of file at paramsfilepath1
andfilepath2
to achar *buffer1
andchar *buffer2
. Running this method will produce the following error:a.out(5679) malloc: *** error for object 0x100800000: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug [1] 5679 abort ./a.out
What's going on here is that we're free'ing here without actually having malloc'd the memory to begin with.NOTES:
I would've just fixed this, but I wasn't sure if that would conflict with resolution of #14.