Fix a crash for the case that csync_init fails.

This commit is contained in:
Klaas Freitag 2013-01-22 16:48:36 +01:00
parent 1db825a733
commit 96f9c09e35

View File

@ -661,7 +661,8 @@ char *csync_vio_get_error_string(CSYNC *ctx)
if(ctx->error_string) {
return ctx->error_string;
}
if(VIO_METHOD_HAS_FUNC(ctx->module.method, get_error_string)) {
if(ctx && ctx->module.method &&
VIO_METHOD_HAS_FUNC(ctx->module.method, get_error_string)) {
return ctx->module.method->get_error_string();
}
return NULL;