ucimap: add custom free() callbacks for options, only used on custom datatypes
[project/uci.git] / file.c
diff --git a/file.c b/file.c
index a58e3924048dd0c96d2bc588d1420824b4fb94a5..6b41d683b3dd903067fe5cbba51249354f726e2a 100644 (file)
--- 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);