summaryrefslogtreecommitdiffstats
path: root/source/smbd/reply.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1999-01-07 20:20:22 +0000
committerJeremy Allison <jra@samba.org>1999-01-07 20:20:22 +0000
commitd32fee0ba61539be9ddc90c9e3c6c489e9167362 (patch)
treed90a8647e7e49f63429e7aceaa4b8c6bd49daa7f /source/smbd/reply.c
parent6ad70f0d9202f00df714f36edfbddb99d2bba83c (diff)
downloadsamba-d32fee0ba61539be9ddc90c9e3c6c489e9167362.tar.gz
samba-d32fee0ba61539be9ddc90c9e3c6c489e9167362.tar.xz
samba-d32fee0ba61539be9ddc90c9e3c6c489e9167362.zip
Now we're mallocing our directory handles rather then using a static
array, leaks are rather more severe :-). This fixes a bug in trans2 findfirst where I forgot to close a directory handle if returning a 'no such file' error. Also fixed a similar case in smbsearch. Jeremy.
Diffstat (limited to 'source/smbd/reply.c')
-rw-r--r--source/smbd/reply.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/smbd/reply.c b/source/smbd/reply.c
index b13563182c9..ad317caac93 100644
--- a/source/smbd/reply.c
+++ b/source/smbd/reply.c
@@ -1285,6 +1285,11 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
{
CVAL(outbuf,smb_rcls) = ERRDOS;
SSVAL(outbuf,smb_err,ERRnofiles);
+ if(dptr_num != -1)
+ {
+ dptr_close(dptr_num);
+ dptr_num = -1;
+ }
}
/* If we were called as SMBffirst with smb_search_id == NULL
@@ -1297,6 +1302,7 @@ int reply_search(connection_struct *conn, char *inbuf,char *outbuf, int dum_size
SSVAL(outbuf,smb_err,ERRnofiles);
/* Also close the dptr - we know it's gone */
dptr_close(dptr_num);
+ dptr_num = -1;
}
/* If we were called as SMBfunique, then we can close the dirptr now ! */