mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r16589: Fix Klocwork #1999. Although it should be impossible to
get duplicate OID's returned in the oids_out list it is still good programming practice to clear out a malloc'ed string before re-writing it (especially in a loop). Jeremy
This commit is contained in:
parent
16b0617cb0
commit
ae02c05bfc
@ -283,22 +283,27 @@ ADS_STATUS ads_check_posix_schema_mapping(ADS_STRUCT *ads, enum wb_posix_mapping
|
||||
|
||||
if (strequal(ADS_ATTR_RFC2307_UIDNUMBER_OID, oids_out[i]) ||
|
||||
strequal(ADS_ATTR_SFU_UIDNUMBER_OID, oids_out[i])) {
|
||||
SAFE_FREE(ads->schema.posix_uidnumber_attr);
|
||||
ads->schema.posix_uidnumber_attr = SMB_STRDUP(names_out[i]);
|
||||
}
|
||||
if (strequal(ADS_ATTR_RFC2307_GIDNUMBER_OID, oids_out[i]) ||
|
||||
strequal(ADS_ATTR_SFU_GIDNUMBER_OID, oids_out[i])) {
|
||||
SAFE_FREE(ads->schema.posix_gidnumber_attr);
|
||||
ads->schema.posix_gidnumber_attr = SMB_STRDUP(names_out[i]);
|
||||
}
|
||||
if (strequal(ADS_ATTR_RFC2307_HOMEDIR_OID, oids_out[i]) ||
|
||||
strequal(ADS_ATTR_SFU_HOMEDIR_OID, oids_out[i])) {
|
||||
SAFE_FREE(ads->schema.posix_homedir_attr);
|
||||
ads->schema.posix_homedir_attr = SMB_STRDUP(names_out[i]);
|
||||
}
|
||||
if (strequal(ADS_ATTR_RFC2307_SHELL_OID, oids_out[i]) ||
|
||||
strequal(ADS_ATTR_SFU_SHELL_OID, oids_out[i])) {
|
||||
SAFE_FREE(ads->schema.posix_shell_attr);
|
||||
ads->schema.posix_shell_attr = SMB_STRDUP(names_out[i]);
|
||||
}
|
||||
if (strequal(ADS_ATTR_RFC2307_GECOS_OID, oids_out[i]) ||
|
||||
strequal(ADS_ATTR_SFU_GECOS_OID, oids_out[i])) {
|
||||
SAFE_FREE(ads->schema.posix_gecos_attr);
|
||||
ads->schema.posix_gecos_attr = SMB_STRDUP(names_out[i]);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user