Skip to content

Commit

Permalink
fix crash when getting with -data and node exists but has no data
Browse files Browse the repository at this point in the history
  • Loading branch information
lehenbauer committed Jan 25, 2017
1 parent 28558f0 commit 94ee03b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions generic/zookeepertcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,9 +1488,10 @@ zootcl_get_subcommand(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], ZOOAP
return TCL_ERROR;
}
status = zsc->rc;
if ((status == ZNONODE) && (dataVarObj != NULL)) {
// node doesn't exist and they specified -data,
// unset data var and version var if defined and
if (((status == ZNONODE) || (zsc->dataObj == NULL)) && (dataVarObj != NULL)) {
// node doesn't exist or contains no data
// and they specified -data, unset their
// specified data var and version var and
// return 0 indicating no node
Tcl_UnsetVar (interp, Tcl_GetString (dataVarObj), 0);
if (versionVarObj != NULL) {
Expand Down

0 comments on commit 94ee03b

Please sign in to comment.