Use strdup to copy strings
[openafs.git] / src / rx / bulktest / bulk_client.c
index 87129d0..de7cc73 100644 (file)
@@ -67,15 +67,6 @@ struct async_work {
 
 int async_nProcs = 0;
 
-char *
-allocString(s)
-     char *s;
-{
-    char *new = (char *)malloc(strlen(s) + 1);
-    strcpy(new, s);
-    return new;
-}
-
 void
 async_BulkProc(data)
      char *data;
@@ -140,8 +131,8 @@ async_BulkTest(host, conn, store, count, verbose, file)
        name++;
 /*   sprintf(tempfile, "/usr/tmp/%s.%s", myHostName, name);*/
     sprintf(tempfile, "/usr/tmp/%s", name);
-    work->local = allocString(store ? file : tempfile);
-    work->remote = allocString(store ? tempfile : file);
+    work->local = strdup(store ? file : tempfile);
+    work->remote = strdup(store ? tempfile : file);
     async_nProcs += 1;
     LWP_CreateProcess(async_BulkProc, 3000, RX_PROCESS_PRIORITY, (void *)work,
                      "bulk", &pid);