Skip to content

Commit

Permalink
coprocess: fix double free on dispatch errors (#1933) (#1936)
Browse files Browse the repository at this point in the history
  • Loading branch information
matiasinsaurralde authored and buger committed Oct 12, 2018
1 parent 0d937ce commit 3e41f97
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions coprocess_native.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ func (c *CoProcessor) Dispatch(object *coprocess.Object) (*coprocess.Object, err

// Call the dispatcher (objectPtr is freed during this call):
if err = GlobalDispatcher.Dispatch(unsafe.Pointer(objectPtr), unsafe.Pointer(newObjectPtr)); err != nil {
C.free(unsafe.Pointer(newObjectPtr.p_data))
C.free(unsafe.Pointer(newObjectPtr))
return nil, err
}
newObjectBytes := C.GoBytes(newObjectPtr.p_data, newObjectPtr.length)
Expand Down

0 comments on commit 3e41f97

Please sign in to comment.