summaryrefslogtreecommitdiff
path: root/src/shared/install-printf.c
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2017-01-16 07:56:53 +0100
committerGitHub <noreply@github.com>2017-01-16 07:56:53 +0100
commit8171bcc70f94a07fb59ba0a3bed2ca5c8af57bbb (patch)
tree73f089c6430a77b42553356fb2c260690dba18ae /src/shared/install-printf.c
parent74875a56cf5d7fd47190a78ec9fde71f72503ffe (diff)
parente0489532fd5969be6e261a558cae91005820fc0e (diff)
Merge pull request #5085 from keszybz/variables
Fixes for gcc and coverity warnings
Diffstat (limited to 'src/shared/install-printf.c')
-rw-r--r--src/shared/install-printf.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c
index 823fb61cda..c10ed3d311 100644
--- a/src/shared/install-printf.c
+++ b/src/shared/install-printf.c
@@ -93,9 +93,9 @@ static int specifier_instance(char specifier, void *data, void *userdata, char *
return r;
if (isempty(instance)) {
- instance = strdup(i->default_instance ?: "");
- if (!instance)
- return -ENOMEM;
+ r = free_and_strdup(&instance, i->default_instance ?: "");
+ if (r < 0)
+ return r;
}
*ret = instance;