Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
problem with freeing data
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="rush2balaji, post: 3466990"] In this code: 1 for (tmp = 0; tmp < wordDBSize; tmp++) { 2 word = NULL; 3 word = popStack(wordDB); 4 if (fprintf(dst, "%d: %s\n", tmp + 1, word) < 0) 5 show_err("(antra)[main] Can not write to file. Please check <destination_file> permissions. Exiting."); 6 /* FIXME - PROBLEM HERE - (line below) */ 7 free(word); 8 } In line 3, you get "word" from popStack(). What if word was NULL? popStack() do return NULL on one case. You can't free NULL [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
problem with freeing data
Top