subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1386594 - /subversion/trunk/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
Date Mon, 17 Sep 2012 13:06:15 GMT
Author: stsp
Date: Mon Sep 17 13:06:14 2012
New Revision: 1386594

URL: http://svn.apache.org/viewvc?rev=1386594&view=rev
Log:
* subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
  (get_default_keyring_name): The (currently single) caller of this function
   forgot to free the result string allocated with strdup(). Make use of the
   the existing (but previously unused!) pool argument to fix this.
   Rename POOL to RESULT_POOL and allocate the result in it.

Modified:
    subversion/trunk/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c

Modified: subversion/trunk/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c?rev=1386594&r1=1386593&r2=1386594&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c (original)
+++ subversion/trunk/subversion/libsvn_auth_gnome_keyring/gnome_keyring.c Mon Sep 17 13:06:14
2012
@@ -137,9 +137,9 @@ callback_default_keyring(GnomeKeyringRes
   return;
 }
 
-/* Returns the default keyring name. */
+/* Returns the default keyring name, allocated in RESULT_POOL. */
 static char*
-get_default_keyring_name(apr_pool_t *pool)
+get_default_keyring_name(apr_pool_t *result_pool)
 {
   char *def = NULL;
   struct gnome_keyring_baton key_info;
@@ -158,7 +158,7 @@ get_default_keyring_name(apr_pool_t *poo
       return NULL;
     }
 
-  def = strdup(key_info.keyring_name);
+  def = apr_pstrdup(result_pool, key_info.keyring_name);
   callback_destroy_data_keyring(&key_info);
 
   return def;



Mime
View raw message