Merge pull request #7454 from neosilky/cocci-fixes

Apply more fixes from Coccinelle
This commit is contained in:
Lennart Poettering
2017-11-24 13:29:32 +01:00
committed by GitHub
29 changed files with 41 additions and 96 deletions
+1 -3
View File
@@ -127,9 +127,7 @@ khash* khash_unref(khash *h) {
safe_close(h->fd);
free(h->algorithm);
free(h);
return NULL;
return mfree(h);
}
int khash_dup(khash *h, khash **ret) {
+2 -2
View File
@@ -359,7 +359,7 @@ static int write_to_console(
highlight = LOG_PRI(level) <= LOG_ERR && show_color;
if (show_location) {
snprintf(location, sizeof(location), "(%s:%i) ", file, line);
xsprintf(location, "(%s:%i) ", file, line);
iovec[n++] = IOVEC_MAKE_STRING(location);
}
@@ -798,7 +798,7 @@ static void log_assert(
return;
DISABLE_WARNING_FORMAT_NONLITERAL;
snprintf(buffer, sizeof buffer, format, text, file, line, func);
xsprintf(buffer, format, text, file, line, func);
REENABLE_WARNING;
log_abort_msg = buffer;