qt: Don't use qstrdup in test passphrase cb
* lang/qt/tests/t-support.h (TestPassphraseProvider::getPassphrase): Use gpgrt_asprintf instead of strdup. -- To avoid problems on MacOS we want to avoid strdup so that qgpgme can be built without extensions. But qstrdup allocates with new and not with malloc, so use gpgrt_asprintf instead.
This commit is contained in:
parent
56926c9b50
commit
a09ed3f26a
@ -34,6 +34,8 @@
|
|||||||
#include "interfaces/passphraseprovider.h"
|
#include "interfaces/passphraseprovider.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
|
#include <gpg-error.h>
|
||||||
|
|
||||||
namespace GpgME
|
namespace GpgME
|
||||||
{
|
{
|
||||||
class TestPassphraseProvider : public PassphraseProvider
|
class TestPassphraseProvider : public PassphraseProvider
|
||||||
@ -42,7 +44,9 @@ public:
|
|||||||
char *getPassphrase(const char * /*useridHint*/, const char * /*description*/,
|
char *getPassphrase(const char * /*useridHint*/, const char * /*description*/,
|
||||||
bool /*previousWasBad*/, bool &/*canceled*/) Q_DECL_OVERRIDE
|
bool /*previousWasBad*/, bool &/*canceled*/) Q_DECL_OVERRIDE
|
||||||
{
|
{
|
||||||
return qstrdup("abc");
|
char *ret;
|
||||||
|
gpgrt_asprintf(&ret, "abc");
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} // namespace GpgME
|
} // namespace GpgME
|
||||||
|
Loading…
Reference in New Issue
Block a user