]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-program-client: Make sure program client callback is called only once.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Sun, 25 Feb 2018 19:21:11 +0000 (20:21 +0100)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Sun, 18 Mar 2018 10:53:18 +0000 (12:53 +0200)
src/lib-program-client/program-client.c

index cb5b599e53c64d85f664b08b2e80e75b954ebb9d..c3d1b3d079617bff335a0fff8e5f7e3dcbb3d57c 100644 (file)
@@ -23,10 +23,11 @@ static void
 program_client_callback(struct program_client *pclient, int result,
                        void *context)
 {
-       /* do not call callback when destroying */
-       if (pclient->destroying) return;
        program_client_callback_t *callback = pclient->callback;
-       i_assert(pclient->callback != NULL);
+
+       pclient->callback = NULL;
+       if (pclient->destroying || callback == NULL)
+               return;
        callback(result, context);
 }