memory leaks and buffer problems

andreas moroder claudiamoroder at
Sat Sep 15 05:59:01 GMT 2001


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, 


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");

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");

More information about the samba-technical mailing list