diff options
author | Lennart Poettering <lennart@poettering.net> | 2019-03-06 11:38:28 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2019-03-07 14:46:35 +0100 |
commit | bbe804325ec04ac0a4255944afd3c8897125f678 (patch) | |
tree | 742860268f82bc8f0b0f1e79a121c124f1859bdd | |
parent | units: fix systemd.special man page reference in system-update-cleanup.service (diff) | |
download | systemd-bbe804325ec04ac0a4255944afd3c8897125f678.tar.xz systemd-bbe804325ec04ac0a4255944afd3c8897125f678.zip |
catalog: don't make catalog_entry_lang() clobber output params on failure
A minor fix to bring this in-line with our coding style
-rw-r--r-- | src/journal/catalog.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/journal/catalog.c b/src/journal/catalog.c index 4062f12c2d..abf725115c 100644 --- a/src/journal/catalog.c +++ b/src/journal/catalog.c @@ -209,9 +209,15 @@ int catalog_file_lang(const char* filename, char **lang) { return 1; } -static int catalog_entry_lang(const char* filename, int line, - const char* t, const char* deflang, char **lang) { +static int catalog_entry_lang( + const char* filename, + unsigned line, + const char* t, + const char* deflang, + char **ret) { + size_t c; + char *z; c = strlen(t); if (c < 2) @@ -233,10 +239,11 @@ static int catalog_entry_lang(const char* filename, int line, filename, line); } - *lang = strdup(t); - if (!*lang) - return -ENOMEM; + z = strdup(t); + if (!z) + return -ENOMEM; + *ret = z; return 0; } |