diff options
author | smitsohu <smitsohu@gmail.com> | 2018-08-11 21:59:59 +0200 |
---|---|---|
committer | smitsohu <smitsohu@gmail.com> | 2018-08-11 21:59:59 +0200 |
commit | f6d6204aba7ef933f2b8870953f2926c3123a6e4 (patch) | |
tree | 349c19e146314b1c47b742201e0cdb26e4664d97 /src/libtracelog | |
parent | release 0.9.56~rc1 testing (diff) | |
download | firejail-f6d6204aba7ef933f2b8870953f2926c3123a6e4.tar.gz firejail-f6d6204aba7ef933f2b8870953f2926c3123a6e4.tar.zst firejail-f6d6204aba7ef933f2b8870953f2926c3123a6e4.zip |
clear all warnings from cppcheck static code analysis
obtained with: cppcheck --enable=warning --force --inconclusive --quiet ~/firejail/src
Diffstat (limited to 'src/libtracelog')
-rw-r--r-- | src/libtracelog/libtracelog.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libtracelog/libtracelog.c b/src/libtracelog/libtracelog.c index 5ce41aca0..0f8d5a00d 100644 --- a/src/libtracelog/libtracelog.c +++ b/src/libtracelog/libtracelog.c | |||
@@ -64,9 +64,6 @@ static inline uint32_t hash(const char *str) { | |||
64 | } | 64 | } |
65 | 65 | ||
66 | static void storage_add(const char *str) { | 66 | static void storage_add(const char *str) { |
67 | #ifdef DEBUG | ||
68 | printf("add %s\n", str); | ||
69 | #endif | ||
70 | if (!str) { | 67 | if (!str) { |
71 | #ifdef DEBUG | 68 | #ifdef DEBUG |
72 | printf("null pointer passed to storage_add\n"); | 69 | printf("null pointer passed to storage_add\n"); |
@@ -74,6 +71,10 @@ static void storage_add(const char *str) { | |||
74 | return; | 71 | return; |
75 | } | 72 | } |
76 | 73 | ||
74 | #ifdef DEBUG | ||
75 | printf("add %s\n", str); | ||
76 | #endif | ||
77 | |||
77 | ListElem *ptr = malloc(sizeof(ListElem)); | 78 | ListElem *ptr = malloc(sizeof(ListElem)); |
78 | if (!ptr) { | 79 | if (!ptr) { |
79 | fprintf(stderr, "Error: cannot allocate memory\n"); | 80 | fprintf(stderr, "Error: cannot allocate memory\n"); |
@@ -96,15 +97,17 @@ static void storage_add(const char *str) { | |||
96 | static char* cwd = NULL; | 97 | static char* cwd = NULL; |
97 | 98 | ||
98 | static char *storage_find(const char *str) { | 99 | static char *storage_find(const char *str) { |
99 | #ifdef DEBUG | ||
100 | printf("storage find %s\n", str); | ||
101 | #endif | ||
102 | if (!str) { | 100 | if (!str) { |
103 | #ifdef DEBUG | 101 | #ifdef DEBUG |
104 | printf("null pointer passed to storage_find\n"); | 102 | printf("null pointer passed to storage_find\n"); |
105 | #endif | 103 | #endif |
106 | return NULL; | 104 | return NULL; |
107 | } | 105 | } |
106 | |||
107 | #ifdef DEBUG | ||
108 | printf("storage find %s\n", str); | ||
109 | #endif | ||
110 | |||
108 | const char *tofind = str; | 111 | const char *tofind = str; |
109 | int allocated = 0; | 112 | int allocated = 0; |
110 | 113 | ||