You never check the return value of malloc, it's not guaranteed to give you back the amount you requested.
Malloc will either give you the whole amount of memory you requested, or it won't give any memory at all. There's no mid way path. Thanks, Rajat -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/