diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2006-12-27 10:48:43 +0100 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2006-12-27 10:48:43 +0100 |
commit | e5a71411f3cab38fd8222c6a51d4791c330d5de7 (patch) | |
tree | 5922378019a29af9335b14589b5205b7661166b3 /nslcd/netgroup.c | |
parent | 410b6fa99387e1fcfa786a571ac34f84547bfd1e (diff) |
do not allocate new memory with malloc() for each request with a string parameter but use a buffer allocated on the stack instead (this simplifies free()-ing the buffer(s) in case of problems)
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@204 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'nslcd/netgroup.c')
-rw-r--r-- | nslcd/netgroup.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nslcd/netgroup.c b/nslcd/netgroup.c index e79657d..3641783 100644 --- a/nslcd/netgroup.c +++ b/nslcd/netgroup.c @@ -291,7 +291,7 @@ int nslcd_netgroup_byname(FILE *fp) int32_t tmpint32; static struct ent_context *netgroup_context=NULL; - char *name; + char name[256]; /* these are here for now until we rewrite the LDAP code */ struct __netgrent result; char buffer[1024]; @@ -299,7 +299,7 @@ int nslcd_netgroup_byname(FILE *fp) struct ldap_args a; enum nss_status stat=NSS_STATUS_SUCCESS; /* read request parameters */ - READ_STRING_ALLOC(fp,name); + READ_STRING_BUF2(fp,name,sizeof(name)); /* log call */ log_log(LOG_DEBUG,"nslcd_netgroup_byname(%s)",name); /* write the response header */ |