]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile: cleanup append_unexp_config_line()
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 14:53:49 +0000 (15:53 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 8 Dec 2020 15:49:40 +0000 (16:49 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile.c

index 8eb52a70928bf4793f044bd7d1bbb11eb3ec5692..d6db65c7348506e2dcf236a316f1229c4b358739 100644 (file)
@@ -2464,10 +2464,11 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf)
 
        linelen = strlen(line);
        while (conf->unexpanded_alloced <= len + linelen + 2) {
-               char *tmp = realloc(conf->unexpanded_config,
-                                   conf->unexpanded_alloced + 1024);
+               char *tmp;
+
+               tmp = realloc(conf->unexpanded_config, conf->unexpanded_alloced + 1024);
                if (!tmp)
-                       return -1;
+                       return ret_errno(EINVAL);
 
                if (!conf->unexpanded_config)
                        *tmp = '\0';