Update mem.c

added malloc example