UploadManager: Avoid potential memory leak

3 jobs for master in 2 minutes and 34 seconds (queued for 2 minutes and 46 seconds)
Status Name Job ID Coverage
  Test
passed build #134544

00:01:01

passed clazy #134542

00:01:12

passed qmllint #134543

00:00:20