I've checked valgrind resize and found out i have a memory leak , 28 byte lost in 3 blocks to be exact , and i don't know where they are allocated , i think in fread and fwrite , but i dont know how to free them , can anyone help ?

  • Your question doesn't really contain enough information to help, but here are a few things to check: 1.) did you close all the files you opened using fopen? 2.) Have you used malloc, calloc, or realloc anywhere? If so, have you freed that memory? – Sam Gerber Sep 24 '15 at 19:40
  • we're probably gonna need to see some code! – Kareem Sep 27 '15 at 6:06

Unless you've been doing any mallocs (which aren't really needed), my guess is it's because you're not closing all files that you've opened.

  • are you running valgrind with the ./ prefix? ie "valgrind ./resize" – user10078 Nov 8 '15 at 11:53
  • Thanks, Stew G! That turned out to be my problem! – user571403 Jun 23 '16 at 15:01

Not the answer you're looking for? Browse other questions tagged .