async_sock: Move to top level
[tprouty/samba.git] / source3 / printing / print_aix.c
index fd85ca08336ba8e7f04a2172a7ec0b073e8dc462..523be77f358da494d1636009a86dda8527265044 100644 (file)
@@ -49,7 +49,7 @@ bool aix_cache_reload(void)
 
        iEtat = 0;
        /* scan qconfig file for searching <printername>:       */
-       for (;(line = fgets_slash(NULL, 1024, pfile)); safe_free(line)) {
+       for (;(line = fgets_slash(NULL, 1024, pfile)); free(line)) {
                if (*line == '*' || *line == 0)
                        continue;
 
@@ -59,12 +59,13 @@ bool aix_cache_reload(void)
                                continue;
 
                        if ((p = strchr_m(line, ':'))) {
+                               char *saveptr;
                                *p = '\0';
-                               p = strtok(line, ":");
+                               p = strtok_r(line, ":", &saveptr);
                                if (strcmp(p, "bsh") != 0) {
                                        name = talloc_strdup(ctx, p);
                                        if (!name) {
-                                               safe_free(line);
+                                               SAFE_FREE(line);
                                                x_fclose(pfile);
                                                TALLOC_FREE(ctx);
                                                return false;
@@ -84,7 +85,7 @@ bool aix_cache_reload(void)
                                /* probably a good printer ???          */
                                iEtat = 0;
                                if (!pcap_cache_add(name, NULL)) {
-                                       safe_free(line);
+                                       SAFE_FREE(line);
                                        x_fclose(pfile);
                                        TALLOC_FREE(ctx);
                                        return false;
@@ -99,7 +100,7 @@ bool aix_cache_reload(void)
                                /* it's a good virtual printer */
                                iEtat = 0;
                                if (!pcap_cache_add(name, NULL)) {
-                                       safe_free(line);
+                                       SAFE_FREE(line);
                                        x_fclose(pfile);
                                        TALLOC_FREE(ctx);
                                        return false;