Package: lizardfs / 3.12.0+dfsg-3

656.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
Last-Update: 2018-02-12
Forwarded: not-needed
Origin: upstream, https://github.com/lizardfs/lizardfs/commit/35a2bf297925
Bug-Upstream: https://github.com/lizardfs/lizardfs/issues/656
From: Piotr Sarna <sarna@skytechnology.pl>
Date: Tue, 6 Feb 2018 11:22:01 +0100
Subject: Apply fixes for cppcheck errors (Fixes #656)

 This commit fixes the following issues found by cppcheck:
  - not closing va_list in slogger.cc
  - using uninitialized gid in matoclserv.cc
  - memory leak in ping_pong.cc

--- a/src/common/slogger.cc
+++ b/src/common/slogger.cc
@@ -113,8 +113,9 @@
 	va_list ap2;
 	va_copy(ap2, ap);
 	int written = vsnprintf(buf, 1023, format, ap2);
 	if (written < 0) {
+		va_end(ap2);
 		return;
 	}
 	buf[std::min<int>(written, sizeof(buf))] = '\0';
 	va_end(ap2);
--- a/src/master/matoclserv.cc
+++ b/src/master/matoclserv.cc
@@ -4265,8 +4265,9 @@
 		cltoma::fuseSetAcl::deserialize(data, length, messageId, inode, uid, gid, rich_acl);
 	} else {
 		lzfs_pretty_syslog(LOG_WARNING, "LIZ_CLTOMA_FUSE_SET_ACL: unknown packet version");
 		eptr->mode = KILL;
+		return;
 	}
 
 	uint8_t status = matoclserv_check_group_cache(eptr, gid);
 	if (status == LIZARDFS_STATUS_OK) {
--- a/utils/ping_pong.cc
+++ b/utils/ping_pong.cc
@@ -170,8 +170,9 @@
 		printf("unlock at %d failed! - %s\n",
 		       i, strerror(errno));
 		exit(EXIT_FAILURE);
 	}
+	free(val);
 }
 
 int main(int argc, char *argv[])
 {