freeing malloc and checkin it is empty or not

Posted by gcc on Stack Overflow See other posts from Stack Overflow or by gcc
Published on 2010-05-14T11:58:04Z Indexed on 2010/05/14 12:04 UTC
Read the original article Hit count: 152

Filed under:
          char *p;
          p="kjkjk";

          .
          .//there are codes which are  checking another command
          .
          if(.....)//i used pointer p in only that area 
            free(p);
          . 
          . //there are codes which are  checking another command 
          .
          if(p==NULL) //i check whether is empty 
            ....
          if(p==-1)  //can we use "EOF==p " in if statement 
            ...      //are there any usage like that EOF==p
          else
            ....

I think there is big error , but where?

© Stack Overflow or respective owner

Related posts about c