GROUP_MAP *group_map = (GROUP_MAP *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyUnicode_Type, value, return -1;);
+ if (group_map->nt_name != NULL) {
+ TALLOC_FREE(group_map->nt_name);
+ }
if (value == Py_None) {
- fstrcpy(group_map->nt_name, NULL);
+ group_map->nt_name = talloc_strdup(group_map, "");
} else {
- fstrcpy(group_map->nt_name, PyUnicode_AsUTF8(value));
+ group_map->nt_name = talloc_strdup(group_map,
+ PyUnicode_AsUTF8(value));
+ }
+ TALLOC_FREE(frame);
+ if (group_map->nt_name == NULL) {
+ return -1;
}
- talloc_free(frame);
return 0;
}
GROUP_MAP *group_map = (GROUP_MAP *)pytalloc_get_ptr(obj);
PY_CHECK_TYPE(&PyUnicode_Type, value, return -1;);
+ if (group_map->comment != NULL) {
+ TALLOC_FREE(group_map->comment);
+ }
if (value == Py_None) {
- fstrcpy(group_map->comment, NULL);
+ group_map->comment = talloc_strdup(group_map, "");
} else {
- fstrcpy(group_map->comment, PyUnicode_AsUTF8(value));
+ group_map->comment = talloc_strdup(group_map,
+ PyUnicode_AsUTF8(value));
+ }
+ TALLOC_FREE(frame);
+ if (group_map->comment == NULL) {
+ return -1;
}
- talloc_free(frame);
return 0;
}