Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 May 1998 14:04:35 +0100
From:      Jean-Paul Beconne <beconne@nmrc.ucc.ie>
To:        freebsd-questions@FreeBSD.ORG
Subject:   Problem with malloc() and free()
Message-ID:  <355848E3.CC8FFC39@nmrc.ucc.ie>

next in thread | raw e-mail | index | archive | help
I wrote some code using malloc(), realloc() and free(). When I compiled
it
I got an application which has the following problems :

1- when free(pointeur) is reach, the application exited and sent the
following
error : /usr/libexec/ld.so "AMIC" undefined symbol

2- the function printf has a strange behavior :
the code :
printf("something");
printf("variable %s\n", string);
where string is a pointeur (char) manipulated with malloc() and
realloc() is
working.
And the code :
/* printf("something"); */
printf("variable %s\n", string);
sends the error "Segmentation fault".

I am developping the application under FreeBSD 2.2.5 and I don't get the
errors
under Solaris.
Thanks for any help.

J-P. Beconne

-------------------------------------------------------
Dr. Jean-Paul Beconne

National Microelectronics Research Center
CAD Group			
University College		Phone : +353 21 904063
Lee Maltings			Fax : +353 21 270271
Prospect Row			http://nmrc.ucc.ie/
CORK (Ireland)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?355848E3.CC8FFC39>