[Cmake-commits] [cmake-commits] hoffman committed cmCPackTGZGenerator.cxx 1.19.4.2 1.19.4.3

cmake-commits at cmake.org cmake-commits at cmake.org
Wed Oct 28 12:15:42 EDT 2009


Update of /cvsroot/CMake/CMake/Source/CPack
In directory public:/mounts/ram/cvs-serv18987/Source/CPack

Modified Files:
      Tag: CMake-2-8
	cmCPackTGZGenerator.cxx 
Log Message:
RC 4 merge


Index: cmCPackTGZGenerator.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/CPack/cmCPackTGZGenerator.cxx,v
retrieving revision 1.19.4.2
retrieving revision 1.19.4.3
diff -C 2 -d -r1.19.4.2 -r1.19.4.3
*** cmCPackTGZGenerator.cxx	9 Oct 2009 20:11:24 -0000	1.19.4.2
--- cmCPackTGZGenerator.cxx	28 Oct 2009 16:15:38 -0000	1.19.4.3
***************
*** 24,28 ****
  #include <cm_zlib.h>
  #include <libtar/libtar.h>
- #include <memory> // auto_ptr
  #include <fcntl.h>
  #include <errno.h>
--- 24,27 ----
***************
*** 220,226 ****
    };
  
!   // Ok, this libtar is not const safe. for now use auto_ptr hack
    char* realName = new char[ strlen(outFileName) + 1 ];
-   std::auto_ptr<char> realNamePtr(realName);
    strcpy(realName, outFileName);
    int flags = O_WRONLY | O_CREAT;
--- 219,224 ----
    };
  
!   // Ok, this libtar is not const safe. Make a non-const copy of outFileName
    char* realName = new char[ strlen(outFileName) + 1 ];
    strcpy(realName, outFileName);
    int flags = O_WRONLY | O_CREAT;
***************
*** 240,243 ****
--- 238,242 ----
      cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_open(): "
        << strerror(errno) << std::endl);
+     delete [] realName;
      return 0;
      }
***************
*** 258,261 ****
--- 257,261 ----
          << strerror(errno) << std::endl);
        tar_close(t);
+       delete [] realName;
        return 0;
        }
***************
*** 266,269 ****
--- 266,270 ----
        << strerror(errno) << std::endl);
      tar_close(t);
+     delete [] realName;
      return 0;
      }
***************
*** 273,278 ****
--- 274,281 ----
      cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with tar_close(): "
        << strerror(errno) << std::endl);
+     delete [] realName;
      return 0;
      }
+   delete [] realName;
    return 1;
  }



More information about the Cmake-commits mailing list