memory leaks and buffer problems

andreas moroder claudiamoroder at st-ulrich.suedtirol.net
Sat Sep 15 05:59:01 GMT 2001


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)
  }






More information about the samba-technical mailing list