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,
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();
}
#endif
- if (!compressed)
+ if (!compressed && size > 0)
memcpy(o->data.payload, data, size);
r = journal_file_link_data(f, o, p, hash);
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;
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;
if (!r)
return NULL;
- for (s = r, d = r; *s; s++)
+ for (s = str, d = r; *s; s++)
if ((unsigned char) *s < 128)
*(d++) = *s;