summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-09-06 15:48:29 +0000
committerJeremy Allison <jra@samba.org>2001-09-06 15:48:29 +0000
commita92f02a0a05b5309644befe57119e799be08177f (patch)
tree325e3230af0cfab53a5b2ea8869f177c8c2ff1c2
parentfc07eb5eefe30336c4feb2dfa9923f19303a85f6 (diff)
downloadsamba-a92f02a0a05b5309644befe57119e799be08177f.tar.gz
samba-a92f02a0a05b5309644befe57119e799be08177f.tar.bz2
samba-a92f02a0a05b5309644befe57119e799be08177f.zip
Fixed O(N^2) talloc loop when allocating printer name memory - fix from
Richard Bollinger <rabollinger@home.com>. Jeremy. (This used to be commit 408c0595bbeafca87795e5278656471fbe0540e8)
-rw-r--r--source3/param/loadparm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 98bb5abd09..95ba076977 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -3344,8 +3344,8 @@ int lp_servicenumber(char *pszServiceName)
int iService;
for (iService = iNumServices - 1; iService >= 0; iService--)
- if (VALID(iService) &&
- strequal(lp_servicename(iService), pszServiceName))
+ if (VALID(iService) && ServicePtrs[iService]->szService &&
+ strequal(ServicePtrs[iService]->szService, pszServiceName))
break;
if (iService < 0)
DEBUG(7,