confile: cleanup append_unexp_config_line()

parent a7ac0d1e
...@@ -2464,10 +2464,11 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf) ...@@ -2464,10 +2464,11 @@ int append_unexp_config_line(const char *line, struct lxc_conf *conf)
linelen = strlen(line); linelen = strlen(line);
while (conf->unexpanded_alloced <= len + linelen + 2) { while (conf->unexpanded_alloced <= len + linelen + 2) {
char *tmp = realloc(conf->unexpanded_config, char *tmp;
conf->unexpanded_alloced + 1024);
tmp = realloc(conf->unexpanded_config, conf->unexpanded_alloced + 1024);
if (!tmp) if (!tmp)
return -1; return ret_errno(EINVAL);
if (!conf->unexpanded_config) if (!conf->unexpanded_config)
*tmp = '\0'; *tmp = '\0';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment