make sure NULL pointers are not dereferenced

This commit is contained in:
Pierangelo Masarati 2006-05-04 22:07:35 +00:00
parent 9447b9fff4
commit 23c766bbfd
2 changed files with 7 additions and 1 deletions

View file

@ -840,6 +840,8 @@ meta_back_op_result(
*save_rmatch = NULL;
void *rmatch_ctx = NULL;
assert( mc != NULL );
if ( candidate != META_TARGET_NONE ) {
metasingleconn_t *msc = &mc->mc_conns[ candidate ];

View file

@ -800,7 +800,11 @@ really_bad:;
/*
* FIXME: need a better strategy to handle errors
*/
rc = meta_back_op_result( mc, op, rs, META_TARGET_NONE );
if ( mc ) {
rc = meta_back_op_result( mc, op, rs, META_TARGET_NONE );
} else {
rc = rs->sr_err;
}
goto finish;
}