chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c269cec
)
fix a couple of issues found with llvm-analyze
author
Lennart Poettering
<lennart@poettering.net>
Wed, 8 Aug 2012 21:54:21 +0000
(23:54 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Wed, 8 Aug 2012 21:54:21 +0000
(23:54 +0200)
src/core/namespace.c
patch
|
blob
|
history
src/cryptsetup/cryptsetup-generator.c
patch
|
blob
|
history
src/journal/journal-file.c
patch
|
blob
|
history
src/libudev/libudev-list.c
patch
|
blob
|
history
src/readahead/readahead-analyze.c
patch
|
blob
|
history
src/shared/logs-show.c
patch
|
blob
|
history
src/shared/utf8.c
patch
|
blob
|
history
diff --git
a/src/core/namespace.c
b/src/core/namespace.c
index 4bef15fdf570941a91e1e5fd18a6c8c2cd334346..ce10c790742c92bd35caf07bea1532d2b14479eb 100644
(file)
--- a/
src/core/namespace.c
+++ b/
src/core/namespace.c
@@
-312,6
+312,8
@@
int setup_namespace(
goto undo_mounts;
}
goto undo_mounts;
}
+ free(paths);
+
t = old_root_dir + sizeof(root_dir) - 1;
if (umount2(t, MNT_DETACH) < 0)
/* At this point it's too late to turn anything back,
t = old_root_dir + sizeof(root_dir) - 1;
if (umount2(t, MNT_DETACH) < 0)
/* At this point it's too late to turn anything back,
diff --git
a/src/cryptsetup/cryptsetup-generator.c
b/src/cryptsetup/cryptsetup-generator.c
index c6bc65aecfa73dd6a8aa9335fbd0a51e299eaf89..386714b4fd09e8ac67bec1f6854c9328993fa11e 100644
(file)
--- a/
src/cryptsetup/cryptsetup-generator.c
+++ b/
src/cryptsetup/cryptsetup-generator.c
@@
-374,8
+374,8
@@
int main(int argc, char *argv[]) {
if (startswith(p, "luks-"))
p += 5;
if (startswith(p, "luks-"))
p += 5;
- name = strappend("luks-",
*i
);
- device = strappend("UUID=",
*i
);
+ name = strappend("luks-",
p
);
+ device = strappend("UUID=",
p
);
if (!name || !device) {
log_oom();
if (!name || !device) {
log_oom();
diff --git
a/src/journal/journal-file.c
b/src/journal/journal-file.c
index b840124c9fe8815329ac643ef991286a2ee94c62..718dc5d6eaa13f73e77ce8bb5f2106d9a1aa19ed 100644
(file)
--- a/
src/journal/journal-file.c
+++ b/
src/journal/journal-file.c
@@
-788,7
+788,7
@@
static int journal_file_append_data(
}
#endif
}
#endif
- if (!compressed)
+ if (!compressed
&& size > 0
)
memcpy(o->data.payload, data, size);
r = journal_file_link_data(f, o, p, hash);
memcpy(o->data.payload, data, size);
r = journal_file_link_data(f, o, p, hash);
@@
-1057,7
+1057,8
@@
int journal_file_append_entry(JournalFile *f, const dual_timestamp *ts, const st
ts->monotonic < le64toh(f->header->tail_entry_monotonic))
return -EINVAL;
ts->monotonic < le64toh(f->header->tail_entry_monotonic))
return -EINVAL;
- items = alloca(sizeof(EntryItem) * n_iovec);
+ /* alloca() can't take 0, hence let's allocate at least one */
+ items = alloca(sizeof(EntryItem) * MAX(1, n_iovec));
for (i = 0; i < n_iovec; i++) {
uint64_t p;
for (i = 0; i < n_iovec; i++) {
uint64_t p;
@@
-2336,7
+2337,8
@@
int journal_directory_vacuum(const char *directory, uint64_t max_use, uint64_t m
n_list ++;
}
n_list ++;
}
- qsort(list, n_list, sizeof(struct vacuum_info), vacuum_compare);
+ if (n_list > 0)
+ qsort(list, n_list, sizeof(struct vacuum_info), vacuum_compare);
for(i = 0; i < n_list; i++) {
struct statvfs ss;
for(i = 0; i < n_list; i++) {
struct statvfs ss;
diff --git
a/src/libudev/libudev-list.c
b/src/libudev/libudev-list.c
index aec334bcfc52875b25a622ec27b7f33a7241c2e6..5d09b5d2d9ffd855ce74f466e67801886db6cd60 100644
(file)
--- a/
src/libudev/libudev-list.c
+++ b/
src/libudev/libudev-list.c
@@
-186,6
+186,7
@@
struct udev_list_entry *udev_list_entry_add(struct udev_list *list, const char *
if (list->entries == NULL) {
free(entry->name);
free(entry->value);
if (list->entries == NULL) {
free(entry->name);
free(entry->value);
+ free(entry);
return NULL;
}
list->entries_max += add;
return NULL;
}
list->entries_max += add;
diff --git
a/src/readahead/readahead-analyze.c
b/src/readahead/readahead-analyze.c
index 53892b0cf862bf03a60d1e6348e3de3dfb6c8b53..11b2b2dc11819e385a9f323433c4ffb5015d82ec 100644
(file)
--- a/
src/readahead/readahead-analyze.c
+++ b/
src/readahead/readahead-analyze.c
@@
-135,11
+135,11
@@
int main_analyze(const char *pack_path) {
printf("\nHOST: %s"
"TYPE: %c\n"
"MISSING: %d\n"
printf("\nHOST: %s"
"TYPE: %c\n"
"MISSING: %d\n"
- "TOTAL: %l
d
\n",
+ "TOTAL: %l
lu
\n",
line,
a,
missing,
line,
a,
missing,
- tsize);
+
(unsigned long long)
tsize);
return EXIT_SUCCESS;
return EXIT_SUCCESS;
diff --git
a/src/shared/logs-show.c
b/src/shared/logs-show.c
index b6e6a85819882c06c65be4b3279df1e65e578feb..60eb896ade6e76b1b84e2ae175d5c81fcf064697 100644
(file)
--- a/
src/shared/logs-show.c
+++ b/
src/shared/logs-show.c
@@
-273,6
+273,7
@@
finish:
free(message);
free(monotonic);
free(realtime);
free(message);
free(monotonic);
free(realtime);
+ free(priority);
return r;
}
return r;
}
diff --git
a/src/shared/utf8.c
b/src/shared/utf8.c
index a6f5b3f9e5dff38fc28efd4eb1d47943a2f49a87..ea7483f50fa414e91838418fea40c46e9922a0f8 100644
(file)
--- a/
src/shared/utf8.c
+++ b/
src/shared/utf8.c
@@
-275,7
+275,7
@@
char *ascii_filter(const char *str) {
if (!r)
return NULL;
if (!r)
return NULL;
- for (s = r, d = r; *s; s++)
+ for (s =
st
r, d = r; *s; s++)
if ((unsigned char) *s < 128)
*(d++) = *s;
if ((unsigned char) *s < 128)
*(d++) = *s;