diff --git a/lang/cpp/src/importresult.cpp b/lang/cpp/src/importresult.cpp index 20a3174b..803c34db 100644 --- a/lang/cpp/src/importresult.cpp +++ b/lang/cpp/src/importresult.cpp @@ -48,7 +48,9 @@ public: // We just need to handle the pointers in the structs: for (gpgme_import_status_t is = r.imports ; is ; is = is->next) { gpgme_import_status_t copy = new _gpgme_import_status(*is); - copy->fpr = strdup(is->fpr); + if (is->fpr) { + copy->fpr = strdup(is->fpr); + } copy->next = nullptr; imports.push_back(copy); }