]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix small memory leak when starting a job with PluginOptions
authorEric Bollengier <eric@baculasystems.com>
Tue, 13 Sep 2022 07:52:00 +0000 (09:52 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:59 +0000 (13:56 +0200)
bacula/src/dird/ua_run.c

index 05467a3eb9ea6ba2778d4a35af14706fddff230e..3ce31335da2d4f90a1d1246c5efa359d569d79c6 100644 (file)
@@ -2567,7 +2567,7 @@ static bool scan_run_command_line_arguments(UAContext *ua, run_ctx &rc)
                   ua->send_msg(_("Plugin Options specified twice.\n"));
                   return false;
                }
-               rc.plugin_options = bstrdup(ua->argv[i]);
+               rc.plugin_options = ua->argv[i];
                if (!acl_access_ok(ua, PluginOptions_ACL, rc.plugin_options)) {
                   ua->send_msg(_("No authorization for \"PluginOptions\" specification.\n"));
                   return false;
@@ -2717,7 +2717,6 @@ static bool scan_run_command_line_arguments(UAContext *ua, run_ctx &rc)
       return false;
    }
 
-
    if (!get_client(ua, rc)) {
       return false;
    }
@@ -2737,7 +2736,7 @@ static bool scan_run_command_line_arguments(UAContext *ua, run_ctx &rc)
    }
 
    if (rc.job->JobType == JT_VERIFY && !rc.plugin_options && rc.job->PluginOptions) {
-      rc.plugin_options = bstrdup(rc.job->PluginOptions);
+      rc.plugin_options = rc.job->PluginOptions;
    }
 
    if (rc.previous_job_name) {