From: oliskoli Date: Sat, 29 Apr 2006 21:57:05 +0000 (+0000) Subject: Fix memory leaks. X-Git-Tag: archive/raspbian/1.10.0+ds-2+rpi1~1^2~12^2~11^2~2907 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f332dbeb9fba44f98efccf15fd6893cfc37dd33e;p=gpsbabel.git Fix memory leaks. --- diff --git a/gpsbabel/interpolate.c b/gpsbabel/interpolate.c index f5a1d9c4a..f054ae4a4 100644 --- a/gpsbabel/interpolate.c +++ b/gpsbabel/interpolate.c @@ -83,12 +83,9 @@ interpfilt_process(void) timen += interval ) { waypoint *wpt_new = waypt_dupe(wpt); wpt_new->creation_time = timen; - xfree(wpt_new->shortname); - if (wpt_new->description) { - xfree(wpt_new->description); - wpt_new->description = NULL; - } - wpt_new->shortname = wpt_new->description = 0; + if (wpt_new->shortname) xfree(wpt_new->shortname); + if (wpt_new->description) xfree(wpt_new->description); + wpt_new->shortname = wpt_new->description = NULL; linepart( lat1, lon1, wpt->latitude, wpt->longitude, (double)(timen-time1)/ @@ -112,12 +109,9 @@ interpfilt_process(void) waypoint *wpt_new = waypt_dupe(wpt); wpt_new->creation_time = distn/curdist* (wpt->creation_time - time1) + time1; - xfree(wpt_new->shortname); - if (wpt_new->description) { - xfree(wpt_new->description); - wpt_new->description = NULL; - } - wpt_new->shortname = wpt_new->description = 0; + if (wpt_new->shortname) xfree(wpt_new->shortname); + if (wpt_new->description) xfree(wpt_new->description); + wpt_new->shortname = wpt_new->description = NULL; linepart( lat1, lon1, wpt->latitude, wpt->longitude, distn/curdist,