Fix crash when setting a NULL error

This commit is contained in:
Olivier Goffart 2013-04-03 10:53:20 +02:00
parent 296011436a
commit 9939e325cf

View file

@ -60,7 +60,7 @@ static int _csync_cleanup_cmp(const void *a, const void *b) {
static void _csync_file_stat_set_error(csync_file_stat_t *st, const char *error)
{
st->instruction = CSYNC_INSTRUCTION_ERROR;
if (st->error_string)
if (st->error_string || !error)
return; // do not override first error.
st->error_string = c_strdup(error);
}