X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=fish%2Fprep.c;h=9863bc9699e119c3c339f134ef7a749792e8cfe7;hb=54e91da925323642e67b8ce4b95899fe4b7a51c4;hp=8b830719cd2386c56f075f7ffbb2c82f768c9c17;hpb=45f72c804b6fa76d94b7195bd5faea8c0d6f6b3d;p=libguestfs.git diff --git a/fish/prep.c b/fish/prep.c index 8b83071..9863bc9 100644 --- a/fish/prep.c +++ b/fish/prep.c @@ -13,7 +13,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #include @@ -116,7 +116,7 @@ Use 'guestfish -N help' to list possible values for the -N parameter.\n"), } for (i = 0; i < data->prep->nr_params; ++i) - data->params[i] = data->prep->params[i].pdefault; + data->params[i] = bad_cast (data->prep->params[i].pdefault); /* Parse the optional parameters. */ const char *p = type_string + len; @@ -167,3 +167,16 @@ prep_error (prep_data *data, const char *filename, const char *fs, ...) exit (EXIT_FAILURE); } + +void +free_prep_data (void *vp) +{ + prep_data *data = vp; + size_t i; + + for (i = 0; i < data->prep->nr_params; ++i) + if (data->params[i] != data->prep->params[i].pdefault) + free (data->params[i]); + free (data->params); + free (data); +}