Hans Leidekker : msi: Fix another double free.

Alexandre Julliard julliard at winehq.org
Mon Apr 20 11:33:13 CDT 2009


Module: wine
Branch: master
Commit: 55ad3fdda2453d36cda66f286b08cf5620c02523
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=55ad3fdda2453d36cda66f286b08cf5620c02523

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Mon Apr 20 16:09:12 2009 +0200

msi: Fix another double free.

parser_alloc() allocates memory and puts it on a list attached the to query object.
EXPR_sval() frees memory allocated via parser_alloc() on error but does not remove
the pointer from the list, which means that when the query destructor is called it
will be freed again.

---

 dlls/msi/sql.y |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/dlls/msi/sql.y b/dlls/msi/sql.y
index 425b584..d71c186 100644
--- a/dlls/msi/sql.y
+++ b/dlls/msi/sql.y
@@ -876,10 +876,7 @@ static struct expr * EXPR_sval( void *info, const struct sql_str *str )
     {
         e->type = EXPR_SVAL;
         if( SQL_getstring( info, str, (LPWSTR *)&e->u.sval ) != ERROR_SUCCESS )
-        {
-            msi_free( e );
-            return NULL;
-        }
+            return NULL; /* e will be freed by query destructor */
     }
     return e;
 }




More information about the wine-cvs mailing list