Merge lp:~zorba-coders/zorba/bug-1021025 into lp:zorba

Proposed by Dennis Knochenwefel
Status: Merged
Approved by: Till Westmann
Approved revision: 10912
Merged at revision: 10914
Proposed branch: lp:~zorba-coders/zorba/bug-1021025
Merge into: lp:zorba
Diff against target: 38 lines (+5/-2)
1 file modified
src/runtime/json/json_impl.cpp (+5/-2)
To merge this branch: bzr merge lp:~zorba-coders/zorba/bug-1021025
Reviewer Review Type Date Requested Status
Till Westmann Approve
Ghislain Fourny Approve
Review via email: mp+113442@code.launchpad.net

Commit message

fixed memory leak reading data of zstring after destruction. Encoded illegal char in exception to not cause any problems.

Description of the change

fix for bug #1021025

To post a comment you must log in.
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1021025-2012-07-04T18-07-03.899Z is finished. The final status was:

All tests succeeded!

Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Voting does not meet specified criteria. Required: Approve > 1, Disapprove < 1, Needs Fixing < 1, Pending < 1. Got: 2 Pending.

Revision history for this message
Ghislain Fourny (gislenius) wrote :

Nice catch Dennis :-)

review: Approve
Revision history for this message
Till Westmann (tillw) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue job bug-1021025-2012-07-05T16-52-53.307Z is finished. The final status was:

All tests succeeded!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/runtime/json/json_impl.cpp'
2--- src/runtime/json/json_impl.cpp 2012-06-28 04:14:03 +0000
3+++ src/runtime/json/json_impl.cpp 2012-07-04 18:06:19 +0000
4@@ -25,6 +25,7 @@
5 #include "system/globalenv.h"
6
7 #include "util/mem_streambuf.h"
8+#include "util/string_util.h"
9
10 #include "jsonml_array.h"
11 #include "snelson.h"
12@@ -63,6 +64,7 @@
13 options_type options;
14 istringstream iss;
15 mem_streambuf buf;
16+ zstring s;
17
18 PlanIteratorState *state;
19 DEFAULT_STACK_INIT( PlanIteratorState, state, planState );
20@@ -78,7 +80,6 @@
21 if ( cur_item->isStreamable() ) {
22 is = &cur_item->getStream();
23 } else {
24- zstring s;
25 cur_item->getStringValue2( s );
26 // Doing it this way uses the string data in-place with no copy.
27 buf.set( s.data(), s.size() );
28@@ -104,7 +105,9 @@
29 catch ( json::illegal_character const &e ) {
30 throw XQUERY_EXCEPTION(
31 zerr::ZJPE0001_ILLEGAL_CHARACTER,
32- ERROR_PARAMS( e.get_char() ),
33+ ERROR_PARAMS(zstring("#x") +
34+ BUILD_STRING(std::uppercase << std::hex
35+ << (static_cast<unsigned int>(e.get_char()) & 0xFF)) ),
36 ERROR_LOC( e.get_loc() )
37 );
38 }

Subscribers

People subscribed via source and target branches