mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ldif_fetch_url() would return NULL value or pointless memory if file was empty
This commit is contained in:
parent
1edcd14a79
commit
2dcf00b82f
@ -87,6 +87,15 @@ ldif_fetch_url(
|
|||||||
|
|
||||||
fclose( url );
|
fclose( url );
|
||||||
|
|
||||||
|
if( total == 0 ) {
|
||||||
|
char *newp = ber_memrealloc( p, 1 );
|
||||||
|
if( newp == NULL ) {
|
||||||
|
ber_memfree( p );
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
p = newp;
|
||||||
|
}
|
||||||
|
|
||||||
*valuep = p;
|
*valuep = p;
|
||||||
*vlenp = total;
|
*vlenp = total;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user