Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
sonar: plug a memleak
authorMartin Quinson <martin.quinson@loria.fr>
Sun, 3 Dec 2017 22:01:07 +0000 (23:01 +0100)
committerMartin Quinson <martin.quinson@loria.fr>
Sun, 3 Dec 2017 22:01:07 +0000 (23:01 +0100)
examples/s4u/io-file-remote/s4u-io-file-remote.cpp

index 46fbede..af61362 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014-2016. The SimGrid Team. All rights reserved.          */
+/* Copyright (c) 2014-2017. The SimGrid Team. All rights reserved.          */
 
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
@@ -39,6 +39,7 @@ static int host(int argc, char* argv[])
       XBT_INFO("Move '%s' (of size %llu) from '%s' to '%s'", filename, file->size(),
                simgrid::s4u::Host::current()->getCname(), argv[3]);
       file->remoteMove(simgrid::s4u::Host::by_name(argv[3]), argv[4]);
+      delete file;
     } else {
       XBT_INFO("Copy '%s' (of size %llu) from '%s' to '%s'", filename, file->size(),
                simgrid::s4u::Host::current()->getCname(), argv[3]);