mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-09 09:54:25 +09:00
Add error checking of strdup.
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@343 7dcaeef0-15fb-0310-b436-a5af3365683c
This commit is contained in:
@@ -591,6 +591,9 @@ static int match(char *group,char *object){
|
|||||||
char *ptr,*saved;
|
char *ptr,*saved;
|
||||||
char *end;
|
char *end;
|
||||||
ptr=strdup(group);
|
ptr=strdup(group);
|
||||||
|
if (ptr == NULL) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
saved=ptr;
|
saved=ptr;
|
||||||
while(1){
|
while(1){
|
||||||
end=strchr(ptr,',');
|
end=strchr(ptr,',');
|
||||||
|
|||||||
Reference in New Issue
Block a user