Re: I'm having a crashing problem with FreeTDS under OSX

Daniel Parnell <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
The documentation for both strdup and asprintf say that the memory  
returned can be deallocated with free.
I tried running something similar to the sample below and it worked as  
expected.  It's really weird!

Daniel

On 08/03/2009, at 10:42 PM, Frediano Ziglio wrote:

> 2009/3/8 Daniel Parnell <[email protected]>:
>> Here is the version output from gcc
>>
>> i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)
>>
>> I wasn't aware that FreeTDS used it's own memory allocator.
>> I've not had any problems like this with any of the installs I've  
>> done
>> in the past (and I've done a lot of them).
>>
>> Daniel
>>
>
> no, no FreeTDS haven't any special memory allocator, just
> malloc/calloc/free. However even strdup and (v)asprintf return
> pointers to be freed with free so they should use same allocators. It
> would be interesting to understand which libraries your compiler
> use... mmm... try to compile a simple program like (mem.c)
>
> #include <stdio.h>
> #include <stdlib.h>
> #include <string.h>
>
> int main()
> {
>   char *s = strdup("hi");
>   void *p = malloc(100);
>   free(p);
>  return 0;
> }
>
> with
>
> gcc -o mem -Wall -s -O2 mem.c
>
> and pass result (mem)
>
> freddy77
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.