[Solved] Valgrind reports memory leak though there isn’t one [c]


Shouldn’t the last line be fclose(fp)?

I think that’s where things are going wrong.

Change pclose(fp) to fclose(fp).

fopen() -> fclose()

popen() -> pclose()

0

solved Valgrind reports memory leak though there isn’t one [c]