diff options
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | runtime/cfsysline.c | 9 |
2 files changed, 9 insertions, 3 deletions
@@ -1,5 +1,8 @@ --------------------------------------------------------------------------- Version 5.8.12 [V5-stable] 2012-05-?? +- support for resolving huge groups + closes: http://bugzilla.adiscon.com/show_bug.cgi?id=310 + Thanks to Alec Warner for the patch - bugfix: delayble source could block action queue, even if there was a disk queue associated with it. The root cause of this problem was that it makes no sense to delay messages once they arrive in the diff --git a/runtime/cfsysline.c b/runtime/cfsysline.c index a33810ed..08ca65ca 100644 --- a/runtime/cfsysline.c +++ b/runtime/cfsysline.c @@ -342,8 +342,8 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p struct group gBuf; DEFiRet; uchar szName[256]; - long bufSize = 2048; - char * stringBuf = malloc(bufSize); + int bufSize = 2048; + char * stringBuf = NULL; assert(pp != NULL); assert(*pp != NULL); @@ -353,13 +353,15 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p ABORT_FINALIZE(RS_RET_NOT_FOUND); } + + CHKmalloc(stringBuf = malloc(bufSize)); while(pgBuf == NULL) { errno = 0; getgrnam_r((char*)szName, &gBuf, stringBuf, bufSize, &pgBuf); if((pgBuf == NULL) && (errno == ERANGE)) { /* Increase bufsize and try again.*/ bufSize *= 2; - stringBuf = realloc(stringBuf, bufSize); + CHKmalloc(stringBuf = realloc(stringBuf, bufSize)); } } @@ -380,6 +382,7 @@ static rsRetVal doGetGID(uchar **pp, rsRetVal (*pSetHdlr)(void*, uid_t), void *p skipWhiteSpace(pp); /* skip over any whitespace */ finalize_it: + free(stringBuf); RETiRet; } |