]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Remove keep alive timer on vmbackup error
authorVMware, Inc <>
Fri, 12 Apr 2013 19:39:05 +0000 (12:39 -0700)
committerDmitry Torokhov <dtor@vmware.com>
Wed, 17 Apr 2013 19:16:42 +0000 (12:16 -0700)
If an error occurs in VmBackupStartCommon, the keepAlive timer is not
stopped.  This can lead to a crash when the timer callback runs after
gBackupState is NULL.

Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
open-vm-tools/services/plugins/vmbackup/stateMachine.c

index 4b3cc54f1531dfc74fdf6aa3491ea30eb517a561..a17fda086b81478af056458ebce7e1b2de834bb1 100644 (file)
@@ -698,6 +698,11 @@ VmBackupStartCommon(RpcInData *data,
    return RPCIN_SETRETVALS(data, "", TRUE);
 
 error:
+   if (gBackupState->keepAlive != NULL) {
+      g_source_destroy(gBackupState->keepAlive);
+      g_source_unref(gBackupState->keepAlive);
+      gBackupState->keepAlive = NULL;
+   }
    if (gBackupState->provider) {
       gBackupState->provider->release(gBackupState->provider);
    }