libkrun icon indicating copy to clipboard operation
libkrun copied to clipboard

Fix unitialized access of err and erroneous error message.

Open haesbaert opened this issue 3 years ago • 4 comments

malloc(3) already sets errno and we should return on NULL.

Hi, sorry if this is too silly I was just going over the code and noticed it, also you could use err(3) or errx(3) and cut some lines. I have more silly fixes like this I can push if you want.

haesbaert avatar Jan 19 '22 21:01 haesbaert

I don't have a proper setup to test this yet for regressions, so I didn't build it.

Again, I apologize if the changes are too pedantic.

haesbaert avatar Jan 19 '22 21:01 haesbaert

Hi! Thanks a lot for taking the interest in working on this. Your changes look good to me, just a couple of comments:

  • Could you please add a Sign-off-by line to the commits?

  • Importing one of the ideas from Rust formatting, I'd prefer to avoid if-else blocks without braces, as I find them prone to errors. Could you please re-add them?

slp avatar Jan 21 '22 11:01 slp

Thanks for reviewing it. I've re-added the braces as requested as well as the Sign-off-by.

haesbaert avatar Jan 24 '22 10:01 haesbaert

@haesbaert There seems to be some conflicts with this PR as a lot has been done since its submission. Do you mind rebasing on main?

tylerfanelli avatar Apr 22 '24 20:04 tylerfanelli