memory leaks and buffer problems
Simo Sorce
idra at samba.org
Sat Sep 15 06:51:03 GMT 2001
thank you andreas, I've committed the patches.
On Sat, Sep 15, 2001 at 03:01:34PM +0200, andreas moroder wrote:
> Hello,
>
> In smbd/open.c I fount two times ( lines 508 and 1216 ) where memory was used
> in a debug statement after a free() of this same memory.
>
> free((char *)old_shares);
> DEBUG(0,("open_mode_check: FAILED when breaking oplock (%x) on file %s, \
> dev = %x, inode = %.0f\n", old_shares[i].op_type, fname, (unsigned int)dev,
> (double)inode));
>
>
> ----------------
>
> In utils/make_printerdef.c there are memory allocations without a free of
> this memory
>
> At line 577
> chaine=(char *)malloc(sizeof(pstring));
> long_desc=(char *)malloc(sizeof(pstring));
> short_desc=(char *)malloc(sizeof(pstring));
> if (!chaine || !long_desc || !short_desc) {
> fprintf(stderr,"find_desc: Unable to malloc memory\n");
> exit(1);
> }.
>
> The same happens two times in:
>
> temp=(char *)malloc(sizeof(pstring));
> temp2=(char *)malloc(sizeof(pstring));
>
> if(temp == NULL || temp2 == NULL) {
> fprintf(stderr,"lookup_strings: malloc fail !\n");
> exit(1)
> }
>
>
>
--
Simo Sorce idra at samba.org
-------------------------------
Samba Team http://www.samba.org
More information about the samba-technical
mailing list