diff --git a/src/import/import-dkr.c b/src/import/import-dkr.c index 594da547f57..e7dbe0f6626 100644 --- a/src/import/import-dkr.c +++ b/src/import/import-dkr.c @@ -100,6 +100,8 @@ struct DkrImport { dkr_import_on_finished on_finished; void *userdata; + + bool finished; }; #define PROTOCOL_PREFIX "https://" @@ -181,6 +183,11 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DkrImportName*, dkr_import_name_unref); static void dkr_import_finish(DkrImport *import, int error) { assert(import); + if (import->finished) + return; + + import->finished = true; + if (import->on_finished) import->on_finished(import, error, import->userdata); else