From: VMware, Inc <> Date: Fri, 12 Apr 2013 19:39:05 +0000 (-0700) Subject: Remove keep alive timer on vmbackup error X-Git-Tag: 2013.04.16-1098359~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb81c4b9c1e8e905679aad89e5745ef53bd49c05;p=thirdparty%2Fopen-vm-tools.git Remove keep alive timer on vmbackup error 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 --- diff --git a/open-vm-tools/services/plugins/vmbackup/stateMachine.c b/open-vm-tools/services/plugins/vmbackup/stateMachine.c index 4b3cc54f1..a17fda086 100644 --- a/open-vm-tools/services/plugins/vmbackup/stateMachine.c +++ b/open-vm-tools/services/plugins/vmbackup/stateMachine.c @@ -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); }