Memory leaks

Atsushi Nakabayashi nakabayashi at miraclelinux.com
Wed Jul 11 05:36:29 GMT 2007


Hi, samba-tech,

I have found a memory leak in the error path of the samba-3.0.24.

--- source/smbd/ipc.c
527 if (state->setup_count) {
528 unsigned int i;
529 if((state->setup = TALLOC_ARRAY(
530 state, uint16, state->setup_count)) == NULL) {
531 DEBUG(0,("reply_trans: setup malloc fail for %u "
532 "bytes !\n", (unsigned int)
533 (state->setup_count * sizeof(uint16))));
534 TALLOC_FREE(state);
535 END_PROFILE(SMBtrans);
536 return(ERROR_DOS(ERRDOS,ERRnomem));
537 }

The state->data and state->param are not released, when the TALLOC_ARRAY
function returns NULL.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba-3.0.24-memoryleak.patch
Type: text/x-patch
Size: 490 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20070711/5cbd209f/samba-3.0.24-memoryleak.bin


More information about the samba-technical mailing list