A
ala
I have something near to this:
unsigned *p, *a;
p = malloc(80*sizeof(unsigned));
a=p;
if(p==0) exit(1);
<code snip>
/******************/
free(p);
/******************/
Is it possible there is segmentation fault where there is free(p);?
Where is the error if 'p' is the same of 'a' (p==a) and never I had
free (or realloc) p? How detect *where* I wrote the malloc's memory
not in my space allocated?
Thank you
unsigned *p, *a;
p = malloc(80*sizeof(unsigned));
a=p;
if(p==0) exit(1);
<code snip>
/******************/
free(p);
/******************/
Is it possible there is segmentation fault where there is free(p);?
Where is the error if 'p' is the same of 'a' (p==a) and never I had
free (or realloc) p? How detect *where* I wrote the malloc's memory
not in my space allocated?
Thank you