[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Jan 26 16:13:07 MST 2011


The branch, master has been updated
       via  efde1d8 s3-utils: Fixed a resource leak in net_afs.
       via  4fc75c7 s3-utils: Fixed a resource leak in smbta-util.
       via  f419c2b s3-utils: Fixed possible resource leak in net_usershare.
       via  de4ef10 s3-utils: Fixed possible resource leak in smbget.
       via  08dc51d s3-utils: Fixed possible resource leak in smbfilter.
       via  f6f0dac s3-modules: Fixed the for-loop code block.
       via  2c47368 s3-lib: Fixed a missing return value in tldap.
      from  278c6f8 errormap: Add unix_to_werror() function

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit efde1d870b6a8c2d5461d9ae6cab5d3f2cbffb83
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 23:15:21 2011 +0100

    s3-utils: Fixed a resource leak in net_afs.
    
    s3-utils: Fixed a resource leak in net_afs.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Thu Jan 27 00:12:47 CET 2011 on sn-devel-104

commit 4fc75c755d0b20ba4f4e1c42471a0355fd85990d
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 23:13:47 2011 +0100

    s3-utils: Fixed a resource leak in smbta-util.
    
    s3-utils: Fixed a resource leak in smbta-util.

commit f419c2b0911788cdd0474bd543ebdbfa52954889
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 23:07:33 2011 +0100

    s3-utils: Fixed possible resource leak in net_usershare.
    
    s3-utils: Fixed possible resource leak in net_usershare.

commit de4ef101c165cf735938f914f7da620daea91762
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 15:18:10 2011 +0100

    s3-utils: Fixed possible resource leak in smbget.
    
    s3-utils: Fixed possible resource leak in smbget.

commit 08dc51d3caabcebf9cc2dc02aac74632831c09b7
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 15:20:34 2011 +0100

    s3-utils: Fixed possible resource leak in smbfilter.
    
    s3-utils: Fixed possible resource leak in smbfilter.

commit f6f0dac4271b2bd1304c2b592c4d2dcbc795afaf
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 23:11:32 2011 +0100

    s3-modules: Fixed the for-loop code block.
    
    s3-modules: Fixed the for-loop code block.

commit 2c47368d682ee908e79bc43d5c865049397440e1
Author: Andreas Schneider <asn at samba.org>
Date:   Wed Jan 19 23:04:13 2011 +0100

    s3-lib: Fixed a missing return value in tldap.
    
    s3-lib: Fixed a missing return value in tldap.

-----------------------------------------------------------------------

Summary of changes:
 source3/lib/tldap.c           |    1 +
 source3/modules/onefs_cbrl.c  |    1 +
 source3/utils/net_afs.c       |    2 ++
 source3/utils/net_usershare.c |    5 +++++
 source3/utils/smbfilter.c     |    1 +
 source3/utils/smbget.c        |    1 +
 source3/utils/smbta-util.c    |    1 +
 7 files changed, 12 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/tldap.c b/source3/lib/tldap.c
index 56cd870..f97dc7c 100644
--- a/source3/lib/tldap.c
+++ b/source3/lib/tldap.c
@@ -2371,6 +2371,7 @@ void tldap_msg_sctrls(struct tldap_message *msg, int *num_sctrls,
 	if (msg == NULL) {
 		*sctrls = NULL;
 		*num_sctrls = 0;
+		return;
 	}
 	*sctrls = msg->res_sctrls;
 	*num_sctrls = talloc_array_length(msg->res_sctrls);
diff --git a/source3/modules/onefs_cbrl.c b/source3/modules/onefs_cbrl.c
index 33f35a7..203710e 100644
--- a/source3/modules/onefs_cbrl.c
+++ b/source3/modules/onefs_cbrl.c
@@ -128,6 +128,7 @@ static struct blocking_lock_record *onefs_cbrl_find_blr(uint64_t id)
 				    onefs_cbrl_blr_state_str(blr)));
 				break;
 			}
+		}
 	} else {
 		for (blr = sconn->smb1.locks.blocking_lock_queue; blr; blr = blr->next) {
 			bs = (struct onefs_cbrl_blr_state *)blr->blr_private;
diff --git a/source3/utils/net_afs.c b/source3/utils/net_afs.c
index 26259c1..f6b2b2d 100644
--- a/source3/utils/net_afs.c
+++ b/source3/utils/net_afs.c
@@ -51,8 +51,10 @@ int net_afs_key(struct net_context *c, int argc, const char **argv)
 
 	if (read(fd, &keyfile, sizeof(keyfile)) != sizeof(keyfile)) {
 		d_fprintf(stderr, _("Could not read keyfile\n"));
+		close(fd);
 		return -1;
 	}
+	close(fd);
 
 	if (!secrets_store_afs_keyfile(argv[1], &keyfile)) {
 		d_fprintf(stderr, _("Could not write keyfile to secrets.tdb\n"));
diff --git a/source3/utils/net_usershare.c b/source3/utils/net_usershare.c
index 61b2caa..f0ee682 100644
--- a/source3/utils/net_usershare.c
+++ b/source3/utils/net_usershare.c
@@ -907,6 +907,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv)
 			  _("net usershare add: cannot lstat tmp file %s\n"),
 			  full_path_tmp );
 		TALLOC_FREE(ctx);
+		close(tmpfd);
 		return -1;
 	}
 
@@ -916,6 +917,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv)
 			  _("net usershare add: cannot fstat tmp file %s\n"),
 			  full_path_tmp );
 		TALLOC_FREE(ctx);
+		close(tmpfd);
 		return -1;
 	}
 
@@ -925,6 +927,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv)
 			    "file ?\n"),
 			  full_path_tmp );
 		TALLOC_FREE(ctx);
+		close(tmpfd);
 		return -1;
 	}
 
@@ -934,6 +937,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv)
 			    "to 0644n"),
 			  full_path_tmp );
 		TALLOC_FREE(ctx);
+		close(tmpfd);
 		return -1;
 	}
 
@@ -957,6 +961,7 @@ static int net_usershare_add(struct net_context *c, int argc, const char **argv)
 			(unsigned int)to_write, full_path_tmp, strerror(errno));
 		unlink(full_path_tmp);
 		TALLOC_FREE(ctx);
+		close(tmpfd);
 		return -1;
 	}
 
diff --git a/source3/utils/smbfilter.c b/source3/utils/smbfilter.c
index 2f78140..136047a 100644
--- a/source3/utils/smbfilter.c
+++ b/source3/utils/smbfilter.c
@@ -44,6 +44,7 @@ static void save_file(const char *fname, void *ppacket, size_t length)
 	}
 	if (write(fd, ppacket, length) != length) {
 		fprintf(stderr,"Failed to write %s\n", fname);
+		close(fd);
 		return;
 	}
 	close(fd);
diff --git a/source3/utils/smbget.c b/source3/utils/smbget.c
index f09c2f6..672e438 100644
--- a/source3/utils/smbget.c
+++ b/source3/utils/smbget.c
@@ -411,6 +411,7 @@ static int smb_download_file(const char *base, const char *name, int recursive,
 				fprintf(stderr, "Offset in local and remote files is different (local: "OFF_T_FORMAT", remote: "OFF_T_FORMAT")\n",
 					(OFF_T_FORMAT_CAST)off1,
 					(OFF_T_FORMAT_CAST)off2);
+				smbc_close(remotehandle); close(localhandle);
 				return 1;
 			}
 
diff --git a/source3/utils/smbta-util.c b/source3/utils/smbta-util.c
index e4f8144..cf90974 100644
--- a/source3/utils/smbta-util.c
+++ b/source3/utils/smbta-util.c
@@ -83,6 +83,7 @@ static void load_key_from_file(char *filename, char *key)
 		fclose(keyfile);
 		exit(1);
 	}
+	fclose(keyfile);
 }
 
 static void create_file_from_key(char *filename)


-- 
Samba Shared Repository


More information about the samba-cvs mailing list