diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2012-09-16 15:47:37 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2012-09-16 15:47:37 +0000 |
commit | e918dde1a1789e49ca030bb74a15e29cfc83c0f1 (patch) | |
tree | db9b2e31bc95941258c4d90c607f1a31ff5848aa | |
parent | 6c0818054092065df184e31b89bba3cc9b4a7b38 (diff) |
swap values and buf assignment to avoid compiler alignment warnings
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1769 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | nslcd/myldap.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/nslcd/myldap.c b/nslcd/myldap.c index de6e670..4bb1252 100644 --- a/nslcd/myldap.c +++ b/nslcd/myldap.c @@ -1566,14 +1566,14 @@ static const char **bervalues_to_values(struct berval **bvalues) for (i=0;i<num_values;i++) sz+=bvalues[i]->bv_len+1; /* allocate the needed memory */ - buf=(char *)malloc(sz); - if (buf==NULL) + values=(char **)malloc(sz); + if (values==NULL) { log_log(LOG_CRIT,"myldap_get_values_len(): malloc() failed to allocate memory"); ldap_value_free_len(bvalues); return NULL; } - values=(char **)buf; + buf=(char *)values; buf+=(num_values+1)*sizeof(char *); /* copy from bvalues */ for (i=0;i<num_values;i++) |