possible memory leak

andreas moroder claudiamoroder at st-ulrich.suedtirol.net
Sat Apr 13 01:00:03 GMT 2002


Hello,

libsmb/clireadwrite.c at there is a possible memory leak.

If realloc fails the memory of the buffers is lost.

static BOOL cli_issue_write(struct cli_state *cli, int fnum, off_t offset, 
uint16 mode, char *buf,
                            size_t size, int i)
{
        char *p;
 
        if (size > cli->bufsize) {
                cli->outbuf = realloc(cli->outbuf, size + 1024);
                cli->inbuf = realloc(cli->inbuf, size + 1024);
                if (cli->outbuf == NULL || cli->inbuf == NULL)
                        return False;
                cli->bufsize = size + 1024;
        }                                  

Bye

Andreas




More information about the samba-technical mailing list