Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: dev-libs/libxml2/files/libxml2-2.7.8-xpath-freeing.patch

Issue 6776028: Upgrade libxml2 and its portage dependencies (Closed) Base URL: ssh://gitrw.chromium.org:9222/portage-stable.git@master
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 From df83c17e5a2646bd923f75e5e507bc80d73c9722 Mon Sep 17 00:00:00 2001
2 From: Daniel Veillard <veillard@redhat.com>
3 Date: Wed, 17 Nov 2010 13:12:14 +0000
4 Subject: Fix a potential freeing error in XPath
5
6 ---
7 diff --git a/xpath.c b/xpath.c
8 index 81e33f6..1447be5 100644
9 --- a/xpath.c
10 +++ b/xpath.c
11 @@ -11763,11 +11763,15 @@ xmlXPathCompOpEvalPositionalPredicate(xmlXPathParserCo ntextPtr ctxt,
12
13 if ((ctxt->error != XPATH_EXPRESSION_OK) || (res == -1)) {
14 xmlXPathObjectPtr tmp;
15 - /* pop the result */
16 + /* pop the result if any */
17 tmp = valuePop(ctxt);
18 - xmlXPathReleaseObject(xpctxt, tmp);
19 - /* then pop off contextObj, which will be freed later */
20 - valuePop(ctxt);
21 + if (tmp != contextObj)
22 + /*
23 + * Free up the result
24 + * then pop off contextObj, which will be freed later
25 + */
26 + xmlXPathReleaseObject(xpctxt, tmp);
27 + valuePop(ctxt);
28 goto evaluation_error;
29 }
30
31 --
32 cgit v0.8.3.1
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698