> Found a leak in svn_ra_dav__open()
> 
> When the repository is parsed with uri_parse(), the
> variable 'uri' has strings allocated via ne_strdup()
> 
> If an errr occurs before the session_baton is created
> then all the strings are lost when the function returns.
> 
> 			Max Okumoto
* subversion/libsvn_ra_dav/session.c
  Fixed leak in svn_ra_dav__open() by freeing string before
  returning when error is detected.
Index: subversion/libsvn_ra_dav/session.c
===================================================================
--- subversion/libsvn_ra_dav/.svn/text-base/session.c.svn-base	Sun Dec  2 13:34:39 2001
+++ subversion/libsvn_ra_dav/session.c	Tue Dec  4 03:36:27 2001
@@ -108,12 +108,14 @@
   if (uri_parse(repository, &uri, NULL) 
       || uri.host == NULL || uri.path == NULL)
     {
+      uri_free(&uri);
       return svn_error_create(SVN_ERR_RA_ILLEGAL_URL, 0, NULL, pool,
                               "illegal URL for repository");
     }
 
   /* Can we initialize network? */
   if (sock_init() != 0) {
+    uri_free(&uri);
     return svn_error_create(SVN_ERR_RA_SOCK_INIT, 0, NULL, pool,
                             "network socket initialization failed");
   }
@@ -151,6 +153,7 @@
         }
       if (ne_set_secure(sess, 1))
         {
+          uri_free(&uri);
           return svn_error_create(SVN_ERR_RA_SOCK_INIT, 0, NULL, pool,
                                   "SSL is not supported");
         }
@@ -173,6 +176,7 @@
 
   if (ne_session_server(sess, uri.host, uri.port))
     {
+      uri_free(&uri);
       return svn_error_createf(SVN_ERR_RA_HOSTNAME_LOOKUP, 0, NULL, pool,
                                "Hostname not found: %s", uri.host);
     }
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:36:51 2006