]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Remove now unused legacy x_strdup function
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 28 Jul 2020 07:04:50 +0000 (09:04 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 28 Jul 2020 12:12:36 +0000 (14:12 +0200)
src/legacy_util.cpp
src/legacy_util.hpp

index 24edc6aaa4bea255b6b0bc0921d98d918af0ea19..9de72e69db494ece809958fd821e234722856ffd 100644 (file)
@@ -120,17 +120,6 @@ format(const char* format, ...)
   return ptr;
 }
 
-// This is like strdup() but dies if the malloc fails.
-char*
-x_strdup(const char* s)
-{
-  char* ret = strdup(s);
-  if (!ret) {
-    fatal("Out of memory in x_strdup");
-  }
-  return ret;
-}
-
 // This is like setenv.
 void
 x_setenv(const char* name, const char* value)
@@ -149,7 +138,7 @@ x_unsetenv(const char* name)
 #ifdef HAVE_UNSETENV
   unsetenv(name);
 #else
-  putenv(x_strdup(name));               // Leak to environment.
+  putenv(strdup(name));                 // Leak to environment.
 #endif
 }
 
index 122a083c67335e93096012dba155afe7e0d5da58..dfb67d817454bfb01edc4016b35a3fe759dc0f6c 100644 (file)
@@ -28,7 +28,6 @@ bool write_fd(int fd, const void* buf, size_t size);
 bool copy_fd(int fd_in, int fd_out);
 const char* get_hostname();
 char* format(const char* format, ...) ATTR_FORMAT(printf, 1, 2);
-char* x_strdup(const char* s);
 void x_setenv(const char* name, const char* value);
 void x_unsetenv(const char* name);
 #ifndef HAVE_LOCALTIME_R