Re: Memory allocation troubles- i think

From: Leonardo Herrera (leonardo.herrera@mercantil.com)
Date: 12/14/00


RJ Bean wrote:
[...]
>new_rec_ptr = (struct known_char_node *) malloc((sizeof(struct
> known_char_node)) + 1); //Allocate Memory
>if(new_rec_ptr != NULL)        //Allocated memory correctly?
>                               //Get data and insert node
>  strcpy(new_rec_ptr->known_char, GET_NAME(ch));

You also need to allocate memory for the known_char member variable.

Regards,
--
Leonardo Herrera
mailto:leonardo.herrera@mercantil.com

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT