s3-passdb: Replace SMB_MALLOC_ARRAY()/SAFE_FREE() with talloc equivalents.
[idra/samba.git] / source3 / utils / net_sam.c
index 4754fb0f34327ba106d212a8faaaa69a74c8f5eb..467e441f60f37cd6c0626a0b986c669be6d564af 100644 (file)
@@ -499,7 +499,7 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv
                const char **names;
                 int i, count;
 
-                account_policy_names_list(&names, &count);
+                account_policy_names_list(talloc_tos(), &names, &count);
                d_fprintf(stderr, _("No account policy \"%s\"!\n\n"), argv[0]);
                d_fprintf(stderr, _("Valid account policies are:\n"));
 
@@ -507,7 +507,8 @@ static int net_sam_policy_set(struct net_context *c, int argc, const char **argv
                        d_fprintf(stderr, "%s\n", names[i]);
                }
 
-               SAFE_FREE(names);
+               TALLOC_FREE(names);
+
                return -1;
        }
 
@@ -551,7 +552,7 @@ static int net_sam_policy_show(struct net_context *c, int argc, const char **arg
                const char **names;
                int count;
                int i;
-                account_policy_names_list(&names, &count);
+                account_policy_names_list(talloc_tos(), &names, &count);
                 d_fprintf(stderr, _("No account policy by that name!\n"));
                 if (count != 0) {
                         d_fprintf(stderr, _("Valid account policies "
@@ -560,7 +561,7 @@ static int net_sam_policy_show(struct net_context *c, int argc, const char **arg
                                d_fprintf(stderr, "%s\n", names[i]);
                        }
                 }
-                SAFE_FREE(names);
+                TALLOC_FREE(names);
                 return -1;
         }
 
@@ -592,7 +593,7 @@ static int net_sam_policy_list(struct net_context *c, int argc, const char **arg
                return 0;
        }
 
-       account_policy_names_list(&names, &count);
+       account_policy_names_list(talloc_tos(), &names, &count);
         if (count != 0) {
                d_fprintf(stderr, _("Valid account policies "
                          "are:\n"));
@@ -600,7 +601,7 @@ static int net_sam_policy_list(struct net_context *c, int argc, const char **arg
                        d_fprintf(stderr, "%s\n", names[i]);
                }
        }
-        SAFE_FREE(names);
+        TALLOC_FREE(names);
         return -1;
 }