conf-parser: fix memory realloc error

Otherwise there is some memory corruption and undefined behavior,
e.g., in my case systemd-udev was always aborted at the
_cleanup_freep_ around that code blocks.
This commit is contained in:
Yin Kangkai
2013-11-25 23:39:11 +01:00
committed by Lennart Poettering
parent 6301a98cdf
commit 4ae7885c2c
+1 -1
View File
@@ -202,7 +202,7 @@ int log_syntax_internal(const char *unit, int level,
continue; \
\
*(xs + i) = x; \
xs = realloc(xs, ++i + 1); \
xs = realloc(xs, (++i + 1) * sizeof(type)); \
if (!xs) \
return -ENOMEM; \
*(xs + i) = invalid; \