Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!TRANSARC.COM!Craig_Everhart From: Craig_Everhart@TRANSARC.COM Newsgroups: comp.soft-sys.andrew Subject: Re: Want messages.FwdHeaders preference Message-ID: <4c0mQYr0BwwOQE=Yp6@transarc.com> Date: 10 Apr 91 14:54:28 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 23 Excerpts from internet.info-andrew: 9-Apr-91 Re: Want messages.FwdHeader.. Adam Stoller (794+0) > I'm not positive, but I think that the getprofile() function returns a > pointer to a centrally allocated string - which can be overwritten by > any other call to getprofile I looked at the ``getprofile'' source code. The function returns a pointer to a centrally-allocated string, but it is not overwritten by any other call to getprofile(). In fact, your profile is loaded exactly once, into a permanently-malloc'ed data structure, and subsequent calls to getprofile() will return pointers to parts of that data structure. Thus, you can go ahead and call getprofile() and use its result without worrying about de-allocating it. In fact, you must never deallocate the char* pointers that getprofile() returns to you. Thus, contrary to Adam's fears, you can call getprofile("fwdheaders") once, save the resultant char* result, and use it as many times as you like. (Of course, you should view the returned data as read-only; don't modify it in place or anything.) Craig