Skip to content

Commit

Permalink
fix a crash in "create" when the node already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
lehenbauer committed Jan 13, 2017
1 parent 890f76e commit 26053a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions generic/zookeepertcl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1835,11 +1835,17 @@ zootcl_create_subcommand(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], ZO
zootcl_syncCallbackContext *zsc = (zootcl_syncCallbackContext *)ckalloc (sizeof (zootcl_syncCallbackContext));
zsc->zo = zo;
zsc->syncDone = 0;

status = zoo_acreate (zh, path, value, valueLen, &ZOO_OPEN_ACL_UNSAFE, flags, zootcl_sync_string_completion_callback, zsc);
if (status != ZOK) {
ckfree (zsc);
return zootcl_set_tcl_return_code (interp, status);
}
if (zootcl_wait (zo, zsc) == TCL_ERROR) {
ckfree (zsc);
return TCL_ERROR;
}
status = zsc->rc;
if (status == ZOK) {
Tcl_SetObjResult (interp, zsc->dataObj);
}
Expand Down

0 comments on commit 26053a5

Please sign in to comment.