From 949ccc8a7ed2a7ad075103e064ad92483ffa8720 Mon Sep 17 00:00:00 2001 From: Stefan Tauner Date: Sun, 15 Sep 2013 14:01:06 +0000 Subject: layout: Add a method to cleanup layout data structures Add layout_cleanup() to layout.c and hook it up in cli_classic.c. Corresponding to flashrom svn r1749. Signed-off-by: Stefan Tauner Acked-by: Carl-Daniel Hailfinger --- layout.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'layout.c') diff --git a/layout.c b/layout.c index 8bb1666..86351b8 100644 --- a/layout.c +++ b/layout.c @@ -3,6 +3,7 @@ * * Copyright (C) 2005-2008 coresystems GmbH * (Written by Stefan Reinauer for coresystems GmbH) + * Copyright (C) 2011-2013 Stefan Tauner * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -189,6 +190,21 @@ int process_include_args(void) return 0; } +void layout_cleanup(void) +{ + int i; + for (i = 0; i < num_include_args; i++) { + free(include_args[i]); + include_args[i] = NULL; + } + num_include_args = 0; + + for (i = 0; i < num_rom_entries; i++) { + rom_entries[i].included = 0; + } + num_rom_entries = 0; +} + romentry_t *get_next_included_romentry(unsigned int start) { int i; -- cgit v1.1