Skip to content

Commit

Permalink
NDMP: fix crash when no drive is available
Browse files Browse the repository at this point in the history
  • Loading branch information
pstorz committed Mar 7, 2018
1 parent 944a880 commit 1113539
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/dird/ndmp_dma_backup_NDMP_NATIVE.c
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ bool do_ndmp_backup_ndmp_native(JCR *jcr)

if ( !ndmp_native_setup_robot_and_tape_for_native_backup_job(jcr, store, ndmp_job)) {
Jmsg(jcr, M_ERROR, 0, _("ndmp_native_setup_robot_and_tape_for_native_backup_job failed\n"));
goto cleanup;
goto bail_out;
}

nis = (NIS *)malloc(sizeof(NIS));
Expand Down Expand Up @@ -437,10 +437,12 @@ bool do_ndmp_backup_ndmp_native(JCR *jcr)
ndma_session_destroy(&ndmp_sess);
}

if (ndmp_sess.param) {
free(ndmp_sess.param->log_tag);
free(ndmp_sess.param);
}
/*
* Free the param block.
*/
free(ndmp_sess.param->log_tag);
free(ndmp_sess.param);
ndmp_sess.param = NULL;

bail_out:
/*
Expand Down

0 comments on commit 1113539

Please sign in to comment.