static int parse_line(char *buffer, void *data)
{
struct config *config;
- char *line;
+ char *line, *linep;
char *dot;
char *key;
char *value;
if (lxc_is_line_empty(buffer))
return 0;
- /* we have to dup the buffer otherwise, at the re-exec for reboot we modified
- * the original string on the stack by replacing '=' by '\0' below
+ /* we have to dup the buffer otherwise, at the re-exec for
+ * reboot we modified the original string on the stack by
+ * replacing '=' by '\0' below
*/
- line = strdup(buffer);
+ linep = line = strdup(buffer);
if (!line) {
SYSERROR("failed to allocate memory for '%s'", buffer);
- goto out;
+ return -1;
}
line += lxc_char_left_gc(line, strlen(line));
ret = config->cb(key, value, data);
out:
- free(line);
+ free(linep);
return ret;
}