1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-28 11:55:23 +03:00

udev: fix invalid free() in enable_name_policy()

static bool enable_name_policy(...) in ./src/udev/net/link-config.c
calls proc_cmdline(...) to get "line" initialized, but
proc_cmdline(...) does not guarantee that atleast when both
conditions (detect_container(NULL) > 0) and
read_full_file(...) returned < 0.
This commit is contained in:
Andreas Henriksson 2014-06-13 18:48:21 +02:00 committed by Tom Gundersen
parent 3e09eb5c83
commit f8a0bb5285

View File

@ -185,7 +185,7 @@ static int load_link(link_config_ctx *ctx, const char *filename) {
} }
static bool enable_name_policy(void) { static bool enable_name_policy(void) {
_cleanup_free_ char *line; _cleanup_free_ char *line = NULL;
char *w, *state; char *w, *state;
int r; int r;
size_t l; size_t l;