malloc/free question..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Under Linux with gcc version 4.4.6 (Debian 4.4.6-11)

The following code:

int main(int argv, char** args)
{
  int *arr;
  int n;

  n = 10000000;

  arr = (int *)malloc(4*n);
  free((void *)&arr);
  exit(0);
}

generates warning:

	err.c:14: warning: attempt to free a non-heap object 'arr'

any ideas?

-ishwar



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux