]> pilppa.com Git - uci.git/commitdiff
fix a small memleak
authorFelix Fietkau <nbd@openwrt.org>
Sun, 3 Feb 2008 07:25:18 +0000 (08:25 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sun, 3 Feb 2008 07:25:18 +0000 (08:25 +0100)
history.c

index dcf94e02000623c77d1649b5068487e339e6569b..202d787614f8d82397301b874a8a23e721e55c3a 100644 (file)
--- a/history.c
+++ b/history.c
@@ -275,13 +275,13 @@ int uci_revert(struct uci_context *ctx, struct uci_package **pkg, char *section,
 
        UCI_INTERNAL(uci_load, ctx, name, &p);
        UCI_TRAP_RESTORE(ctx);
+       ctx->errno = 0;
 
-       goto done;
 error:
        if (name)
                free(name);
-       UCI_THROW(ctx, ctx->errno);
-done:
+       if (ctx->errno)
+               UCI_THROW(ctx, ctx->errno);
        return 0;
 }