Skip to content
Snippets Groups Projects
Commit 2dcf00b8 authored by Hallvard Furuseth's avatar Hallvard Furuseth
Browse files

ldif_fetch_url() would return NULL value or pointless memory if file was empty

parent 1edcd14a
No related branches found
No related tags found
No related merge requests found
......@@ -87,6 +87,15 @@ ldif_fetch_url(
fclose( url );
if( total == 0 ) {
char *newp = ber_memrealloc( p, 1 );
if( newp == NULL ) {
ber_memfree( p );
return -1;
}
p = newp;
}
*valuep = p;
*vlenp = total;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment