]> git.sur5r.net Git - bacula/bacula/commitdiff
Fix segfault on "cancel jobid=" command
authorEric Bollengier <eric@eb.homelinux.org>
Tue, 1 Jun 2010 20:50:17 +0000 (22:50 +0200)
committerEric Bollengier <eric@eb.homelinux.org>
Tue, 1 Jun 2010 20:54:22 +0000 (22:54 +0200)
bacula/src/dird/ua_cmds.c

index 829382f54df9bbdbfdf5c1d1f79b19f6e9eaff42..91a43188b147a429c7062a475ddd5c2ef6a2ae57 100644 (file)
@@ -458,10 +458,10 @@ static int cancel_cmd(UAContext *ua, const char *cmd)
    for (i=1; i<ua->argc; i++) {
       if (strcasecmp(ua->argk[i], NT_("jobid")) == 0) {
          uint32_t JobId;
-         if (!ua->argv[i]) {
+         JobId = str_to_int64(ua->argv[i]);
+         if (!JobId) {
             break;
          }
-         JobId = str_to_int64(ua->argv[i]);
          if (!(jcr=get_jcr_by_id(JobId))) {
             ua->error_msg(_("JobId %s is not running. Use Job name to cancel inactive jobs.\n"),  ua->argv[i]);
             return 1;