Replace most strdup with gmx_strdup
[alexxy/gromacs.git] / src / gromacs / gmxpreprocess / fflibutil.cpp
index 1c2d368216ed2b1bf6568bd3100d6710dce42f2e..c2cbdf488cea41eaf8bb2abfec65b6acc6cd3aad 100644 (file)
@@ -200,7 +200,7 @@ static int low_fflib_search_file_end(const char *ffdir,
                         sprintf(fn_dir, "%s%c%s", dir, DIR_SEPARATOR, nextname);
 
                         /* Copy the file name, possibly including the path. */
-                        fns[n] = strdup(fn_dir);
+                        fns[n] = gmx_strdup(fn_dir);
 
                         if (ffdir == NULL)
                         {
@@ -213,11 +213,11 @@ static int low_fflib_search_file_end(const char *ffdir,
                             srenew(fns_short, n+1);
                             if (strcmp(dir, ".") == 0 || bEnvIsSet)
                             {
-                                fns_short[n] = strdup(fn_dir);
+                                fns_short[n] = gmx_strdup(fn_dir);
                             }
                             else
                             {
-                                fns_short[n] = strdup(nextname);
+                                fns_short[n] = gmx_strdup(nextname);
                             }
                         }
                         n++;
@@ -293,7 +293,7 @@ int fflib_search_file_in_dirend(const char *filename, const char *dirend,
                 {
                     /* We have a match */
                     srenew(dns, n+1);
-                    dns[n] = strdup(f_short[i]);
+                    dns[n] = gmx_strdup(f_short[i]);
                     n++;
                 }
             }