From 726fa732facef55da6a27750f9daf12145db6639 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 22 Apr 2011 09:51:42 +0200 Subject: s3: Fix Coverity ID 2325, RESOURCE_LEAK --- source3/libsmb/libsmb_dir.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source3/libsmb/libsmb_dir.c b/source3/libsmb/libsmb_dir.c index 9939e25fb5..c0c6e83bb6 100644 --- a/source3/libsmb/libsmb_dir.c +++ b/source3/libsmb/libsmb_dir.c @@ -518,6 +518,10 @@ SMBC_opendir_ctx(SMBCCTX *context, ip_list = (struct ip_service *)memdup( &server_addr, sizeof(server_addr)); if (ip_list == NULL) { + if (dir) { + SAFE_FREE(dir->fname); + SAFE_FREE(dir); + } TALLOC_FREE(frame); errno = ENOMEM; return NULL; -- cgit