[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Tue Apr 21 14:15:07 MDT 2015


The branch, master has been updated
       via  6b1f757 s3:lib: use talloc_get_type_abort
       via  86f04bf lib: Fix CID 1107218 Resource leak
       via  6bcc037 tevent: Fix CID 1035381 Unchecked return value
       via  0f91e4e lib: Fix a few CIDs for Resource Leak
       via  b8ac985 ctdb: Fix the O3 developer build
      from  791c644 Add refentryinfo date.

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


- Log -----------------------------------------------------------------
commit 6b1f757f837f051774132152cb9e80d4c86c161e
Author: Ralph Boehme <slow at samba.org>
Date:   Tue Apr 21 18:58:09 2015 +0200

    s3:lib: use talloc_get_type_abort
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Tue Apr 21 22:14:07 CEST 2015 on sn-devel-104

commit 86f04bfc248ffcf2d067adcaf65e1569788fb239
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 31 21:24:45 2015 +0200

    lib: Fix CID 1107218 Resource leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 6bcc037b5b636e88a914f1d39a95eb6eb72937e0
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 31 21:15:53 2015 +0200

    tevent: Fix CID 1035381 Unchecked return value
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 0f91e4e18db5f896c94f98e84f572568d0b1c3e4
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Mar 31 09:34:54 2015 +0200

    lib: Fix a few CIDs for Resource Leak
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit b8ac9853b0483fc4af82f731337464f9b5aaf53c
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Apr 21 10:34:54 2015 +0200

    ctdb: Fix the O3 developer build
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 ctdb/client/ctdb_client.c |  2 +-
 ctdb/tools/ctdb.c         | 20 ++++++++++----------
 lib/tevent/testsuite.c    |  4 +++-
 lib/util/tests/file.c     | 15 ++++++++++-----
 source3/lib/popt_common.c |  7 ++-----
 source3/lib/util_sock.c   |  2 +-
 6 files changed, 27 insertions(+), 23 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c
index f46cfc6..6e18269 100644
--- a/ctdb/client/ctdb_client.c
+++ b/ctdb/client/ctdb_client.c
@@ -3873,7 +3873,7 @@ static bool server_id_exists(struct ctdb_context *ctdb, struct server_id *id)
 {
 	struct ctdb_server_id sid;
 	int ret;
-	uint32_t result;
+	uint32_t result = 0;
 
 	sid.type = SERVER_TYPE_SAMBA;
 	sid.pnn = id->vnn;
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 66d0383..9b7fb11 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -340,7 +340,7 @@ static bool db_exists(struct ctdb_context *ctdb, const char *dbarg,
 	bool dbid_given = false, found = false;
 	uint32_t id;
 	TALLOC_CTX *tmp_ctx = talloc_new(ctdb);
-	const char *name;
+	const char *name = NULL;
 
 	ret = ctdb_ctrl_getdbmap(ctdb, TIMELIMIT(), options.pnn, tmp_ctx, &dbmap);
 	if (ret != 0) {
@@ -2803,7 +2803,7 @@ static int unregsrvid(struct ctdb_context *ctdb, int argc, const char **argv)
  */
 static int chksrvid(struct ctdb_context *ctdb, int argc, const char **argv)
 {
-	uint32_t status;
+	uint32_t status = 0;
 	int ret;
 	struct ctdb_server_id server_id;
 
@@ -4589,9 +4589,9 @@ static int control_getdbmap(struct ctdb_context *ctdb, int argc, const char **ar
 	if(options.machinereadable){
 		printm(":ID:Name:Path:Persistent:Sticky:Unhealthy:ReadOnly:\n");
 		for(i=0;i<dbmap->num;i++){
-			const char *path;
-			const char *name;
-			const char *health;
+			const char *path = NULL;
+			const char *name = NULL;
+			const char *health = NULL;
 			bool persistent;
 			bool readonly;
 			bool sticky;
@@ -4615,9 +4615,9 @@ static int control_getdbmap(struct ctdb_context *ctdb, int argc, const char **ar
 
 	printf("Number of databases:%d\n", dbmap->num);
 	for(i=0;i<dbmap->num;i++){
-		const char *path;
-		const char *name;
-		const char *health;
+		const char *path = NULL;
+		const char *name = NULL;
+		const char *health = NULL;
 		bool persistent;
 		bool readonly;
 		bool sticky;
@@ -4647,8 +4647,8 @@ static int control_getdbstatus(struct ctdb_context *ctdb, int argc, const char *
 	const char *db_name;
 	uint32_t db_id;
 	uint8_t flags;
-	const char *path;
-	const char *health;
+	const char *path = NULL;
+	const char *health = NULL;
 
 	if (argc < 1) {
 		usage();
diff --git a/lib/tevent/testsuite.c b/lib/tevent/testsuite.c
index 34d13bb..e9d1ef4 100644
--- a/lib/tevent/testsuite.c
+++ b/lib/tevent/testsuite.c
@@ -121,6 +121,7 @@ static bool test_event_context(struct torture_context *test,
 #endif
 	int finished=0;
 	struct timeval t;
+	int ret;
 
 	ev_ctx = tevent_context_init_byname(test, backend);
 	if (ev_ctx == NULL) {
@@ -135,7 +136,8 @@ static bool test_event_context(struct torture_context *test,
 	fde_count = 0;
 
 	/* create a pipe */
-	pipe(fd);
+	ret = pipe(fd);
+	torture_assert_int_equal(test, ret, 0, "pipe failed");
 
 	fde_read = tevent_add_fd(ev_ctx, ev_ctx, fd[0], TEVENT_FD_READ,
 			    fde_handler_read, fd);
diff --git a/lib/util/tests/file.c b/lib/util/tests/file.c
index 8508081..f349c21 100644
--- a/lib/util/tests/file.c
+++ b/lib/util/tests/file.c
@@ -66,6 +66,7 @@ static bool test_afdgets(struct torture_context *tctx)
 	int fd;
 	char *line;
 	TALLOC_CTX *mem_ctx = tctx;
+	bool ret = false;
 	
 	torture_assert(tctx, file_save(TEST_FILENAME, (const void *)TEST_DATA, 
 							 strlen(TEST_DATA)),
@@ -76,18 +77,22 @@ static bool test_afdgets(struct torture_context *tctx)
 	torture_assert(tctx, fd != -1, "opening file");
 
 	line = afdgets(fd, mem_ctx, 8);
-	torture_assert(tctx, strcmp(line, TEST_LINE1) == 0, "line 1 mismatch");
+	torture_assert_goto(tctx, strcmp(line, TEST_LINE1) == 0, ret, done,
+			    "line 1 mismatch");
 
 	line = afdgets(fd, mem_ctx, 8);
-	torture_assert(tctx, strcmp(line, TEST_LINE2) == 0, "line 2 mismatch");
+	torture_assert_goto(tctx, strcmp(line, TEST_LINE2) == 0, ret, done,
+			    "line 2 mismatch");
 
 	line = afdgets(fd, mem_ctx, 8);
-	torture_assert(tctx, strcmp(line, TEST_LINE3) == 0, "line 3 mismatch");
-
+	torture_assert_goto(tctx, strcmp(line, TEST_LINE3) == 0, ret, done,
+			    "line 3 mismatch");
+	ret = true;
+done:
 	close(fd);
 
 	unlink(TEST_FILENAME);
-	return true;
+	return ret;
 }
 
 struct torture_suite *torture_local_util_file(TALLOC_CTX *mem_ctx)
diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c
index 6f27bac..44f6aae 100644
--- a/source3/lib/popt_common.c
+++ b/source3/lib/popt_common.c
@@ -368,11 +368,8 @@ static void popt_common_credentials_callback(poptContext con,
 		}
 
 		if (getenv("USER")) {
-			char *puser = SMB_STRDUP(getenv("USER"));
-			if (!puser) {
-				exit(ENOMEM);
-			}
-			set_cmdline_auth_info_username(auth_info, puser);
+			set_cmdline_auth_info_username(auth_info,
+						       getenv("USER"));
 		}
 
 		if (getenv("PASSWD")) {
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 682d964..c4de85d 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1363,7 +1363,7 @@ struct tevent_req *getaddrinfo_send(TALLOC_CTX *mem_ctx,
 static void getaddrinfo_do(void *private_data)
 {
 	struct getaddrinfo_state *state =
-		(struct getaddrinfo_state *)private_data;
+		talloc_get_type_abort(private_data, struct getaddrinfo_state);
 
 	state->ret = getaddrinfo(state->node, state->service, state->hints,
 				 &state->res);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list