From: Felix Fietkau Date: Fri, 4 Sep 2009 00:55:00 +0000 (+0200) Subject: fix a null pointer deref in uci_file_commit when overwriting history data X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=a8436cadedf5893a456c422eec222eb87066c9c5;p=uci.git fix a null pointer deref in uci_file_commit when overwriting history data --- diff --git a/file.c b/file.c index a58e392..6b41d68 100644 --- a/file.c +++ b/file.c @@ -442,15 +442,11 @@ void uci_file_commit(struct uci_context *ctx, struct uci_package **package, bool /* freed together with the uci_package */ path = NULL; - - /* check for updated history, flush */ - if (!uci_load_history(ctx, p, true)) - goto done; - } else { - /* flush history */ - if (!uci_load_history(ctx, NULL, true)) - goto done; } + + /* flush history */ + if (!uci_load_history(ctx, p, true)) + goto done; } rewind(f);