aboutsummaryrefslogtreecommitdiffstats
path: root/e-util/e-pilot-map.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-10-29 10:33:16 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-10-29 10:33:16 +0800
commit891310bddb462fec2a8bd196fc038af5bf857fa5 (patch)
treed1814d58dbfcbaa753add333a3efef1c67a863e9 /e-util/e-pilot-map.c
parent3b397a352fe203284c7442d0b057e3443027bcab (diff)
downloadgsoc2013-evolution-891310bddb462fec2a8bd196fc038af5bf857fa5.tar.gz
gsoc2013-evolution-891310bddb462fec2a8bd196fc038af5bf857fa5.tar.zst
gsoc2013-evolution-891310bddb462fec2a8bd196fc038af5bf857fa5.zip
make sure to free the keys as well (e_pilot_map_remove_by_uid): ditto
2001-10-28 JP Rosevear <jpr@ximian.com> * e-pilot-map.c (e_pilot_map_remove_by_pid): make sure to free the keys as well (e_pilot_map_remove_by_uid): ditto svn path=/trunk/; revision=14315
Diffstat (limited to 'e-util/e-pilot-map.c')
-rw-r--r--e-util/e-pilot-map.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/e-util/e-pilot-map.c b/e-util/e-pilot-map.c
index 01a1552e4f..b1b4e80052 100644
--- a/e-util/e-pilot-map.c
+++ b/e-util/e-pilot-map.c
@@ -216,20 +216,25 @@ e_pilot_map_insert (EPilotMap *map, guint32 pid, const char *uid, gboolean archi
void
e_pilot_map_remove_by_pid (EPilotMap *map, guint32 pid)
{
- EPilotMapPidNode *pnode;
- EPilotMapUidNode *unode;
-
+ EPilotMapPidNode *pnode = NULL;
+ EPilotMapUidNode *unode = NULL;
+ gpointer pkey, ukey;
+
g_return_if_fail (map != NULL);
- pnode = g_hash_table_lookup (map->pid_map, &pid);
- if (!pnode)
+ if (!g_hash_table_lookup_extended (map->pid_map, &pid,
+ &pkey, (gpointer *)&pnode))
return;
- unode = g_hash_table_lookup (map->uid_map, pnode->uid);
-
+ g_hash_table_lookup_extended (map->uid_map, pnode->uid, &ukey,
+ (gpointer *)&unode);
+ g_assert (unode != NULL);
+
g_hash_table_remove (map->pid_map, &pid);
g_hash_table_remove (map->uid_map, pnode->uid);
+ g_free (pkey);
+ g_free (ukey);
g_free (pnode);
g_free (unode);
}
@@ -239,21 +244,23 @@ e_pilot_map_remove_by_uid (EPilotMap *map, const char *uid)
{
EPilotMapPidNode *pnode;
EPilotMapUidNode *unode;
-
+ gpointer pkey, ukey;
+
g_return_if_fail (map != NULL);
g_return_if_fail (uid != NULL);
- unode = g_hash_table_lookup (map->uid_map, uid);
- if (!unode)
+ if (!g_hash_table_lookup_extended (map->uid_map, uid, &ukey, (gpointer *)&unode))
return;
- pnode = g_hash_table_lookup (map->pid_map, &unode->pid);
+ g_hash_table_lookup_extended (map->pid_map, &unode->pid, &pkey, (gpointer *)&pnode);
g_hash_table_remove (map->uid_map, uid);
g_hash_table_remove (map->pid_map, &unode->pid);
- g_free (unode);
+ g_free (pkey);
+ g_free (ukey);
g_free (pnode);
+ g_free (unode);
}
&id=50e5ff23f7a102ee098c5b8e7c416db627f52d99'>- Fix broken makefiles introduced with translation to new SF File Release Systemamdmi32009-08-221-3/+1 * - Switch SourceForge ports to the new File Release System: categories startin...amdmi32009-08-221-2/+3 * Fix a few "bad example" problems in the rc.d scripts that have beendougb2009-07-161-2/+2 * - Fix CacheModule httpsem2008-12-092-1/+19 * Update CONFIGURE_ARGS for how we pass CONFIGURE_TARGET to configure script.rafan2008-08-211-1/+0 * - Fix working with antiviruses on BSD systems.sem2007-12-143-0/+107 * - Remove the DESTDIR modifications from individual ports as we have a new,gabor2007-08-041-4/+4 * - Convert the port to be compliant with DESTDIRsem2006-08-061-7/+6 * - Utilize new features: USE_RC_SUBR, SUB_FILES. It simplifies Makefile.sem2006-02-075-47/+25 * - Yield to a total SHAtification.sem2005-11-111-0/+1 * At Kris's request, back out the MACHINE_ARCH spelling correction untilobrien2005-04-121-1/+1 * Assist getting more ports working on AMD64 by obeying theobrien2005-04-111-1/+1 * - Uptate 0.7.18sem2005-03-012-3/+3 * - Update to 0.7.17sem2004-11-142-3/+3 * The tarball was rerolled by author.sem2004-08-161-2/+2 * Update to 0.7.15sem2004-08-132-4/+6 * Change email address for my ports.sem2004-07-081-1/+1 * - Update to 0.7.14krion2004-05-172-3/+3 * - Fix default optionskrion2004-03-251-3/+8 * - Fix defaults with BATCH=yeskrion2004-03-121-0/+2 * - Update to 0.7.13krion2004-03-052-3/+3 * Bump PORTREVISION on all ports that depend on gettext to aid with upgrading.marcus2004-02-041-0/+1 * - Fix OPTIONS (they must be before bsd.port.pre.mk)pav2004-02-041-9/+9 * - Convert to OPTIONSpav2004-02-021-18/+13 * - Utilize PLIST_FILESsergei2004-01-272-3/+1 * - Update to 0.7.12krion2004-01-195-39/+74 * - Update to 0.7.11krion2003-09-302-2/+2 * - Update to version 0.7.10krion2003-09-242-2/+2 * - Utilize DOCSDIRkrion2003-08-242-28/+28 * update ftp/frox: 0.7.7 --> 0.7.8daichi2003-06-262-2/+2 * * Update to 0.7.7leeym2003-04-085-27/+35 * De-pkg-comment.knu2003-02-212-1/+1 * add MASTER_SITE_SOURCEFORGE to master siteijliao2002-08-081-1/+3 * Add frox 0.7.4, a transparent FTP proxy with caching support.will2002-06-23