diff --git a/lang/cpp/src/data.cpp b/lang/cpp/src/data.cpp index 547ec76e..7a93cbc2 100644 --- a/lang/cpp/src/data.cpp +++ b/lang/cpp/src/data.cpp @@ -256,6 +256,8 @@ std::vector GpgME::Data::toKeys(Protocol proto) const while (!gpgme_op_keylist_next (ctx->impl()->ctx, &key)) { ret.push_back(GpgME::Key(key, false)); } + gpgme_data_seek (d->data, 0, SEEK_SET); + delete ctx; return ret; }