diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2010-03-20 22:55:17 +0000 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2010-03-20 22:55:17 +0000 |
commit | e9de64be97b613749380873b1fb2d7b1d9ff992a (patch) | |
tree | f190b4c54a0302b116c63e869e00e1b5fd0349f4 /libgphoto2_port/libgphoto2_port | |
parent | 39a73521cdc5d115536ae4f08bf950aa097bff0e (diff) | |
download | libgphoto2-e9de64be97b613749380873b1fb2d7b1d9ff992a.tar.gz |
free dynamic allocated names on exit / reset
git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12818 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/libgphoto2_port')
-rw-r--r-- | libgphoto2_port/libgphoto2_port/gphoto2-port.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libgphoto2_port/libgphoto2_port/gphoto2-port.c b/libgphoto2_port/libgphoto2_port/gphoto2-port.c index ee85a00f1..06d18b551 100644 --- a/libgphoto2_port/libgphoto2_port/gphoto2-port.c +++ b/libgphoto2_port/libgphoto2_port/gphoto2-port.c @@ -147,9 +147,12 @@ gp_port_set_info (GPPort *port, GPPortInfo info) CHECK_NULL (port); + if (port->pc->info.name) free (port->pc->info.name); port->pc->info.name = strdup (info->name); + if (port->pc->info.path) free (port->pc->info.path); port->pc->info.path = strdup (info->path); port->pc->info.type = info->type; + if (port->pc->info.library_filename) free (port->pc->info.library_filename); port->pc->info.library_filename = strdup (info->library_filename); port->type = info->type; @@ -320,6 +323,10 @@ gp_port_free (GPPort *port) port->pc->lh = NULL; } + if (port->pc->info.name) free (port->pc->info.name); + if (port->pc->info.path) free (port->pc->info.path); + if (port->pc->info.library_filename) free (port->pc->info.library_filename); + free (port->pc); port->pc = NULL; } |