Skip to content

Commit

Permalink
[#450] Fix M-stack leak in $QUERY(lvn,-1)
Browse files Browse the repository at this point in the history
The r126/random_walk subtest failed with a STACKCRIT error. Analysis of this led to
an M-stack leak from $QUERY(lvn,-1).

Commit (SHA 10d8235) as part of #59 added a push_v1
variable but forgot to initialize it to TRUE in the case where v1 and v2 were being
pushed onto the M-stack. Similar code exists in op_fnquery.c but push_v1 is correctly
initialized there. The same fix is now done in op_fnreversequery.c.
  • Loading branch information
nars1 committed May 10, 2019
1 parent 87cdfca commit d770057
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sr_port/op_fnreversequery.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* *
* Copyright 2001, 2013 Fidelity Information Services, Inc *
* *
* Copyright (c) 2018 YottaDB LLC and/or its subsidiaries. *
* Copyright (c) 2018-2019 YottaDB LLC and/or its subsidiaries. *
* All rights reserved. *
* *
* This source code contains the intellectual property *
Expand Down Expand Up @@ -432,6 +432,7 @@ void op_fnreversequery_va(int sbscnt, mval *dst, va_list var)
v1->mvtype = MV_STR;
v1->str.len = 0;
v1->str.addr = (char *)stringpool.free;
push_v1 = TRUE;
PUSH_MV_STENT(MVST_MVAL);
v2 = &mv_chain->mv_st_cont.mvs_mval;
v2->mvtype = 0; /* initialize it to 0 to avoid "stp_gcol" from getting confused if it gets invoked before v2 has been
Expand Down

0 comments on commit d770057

Please sign in to comment.