diff --git a/libraries/libldif/fetch.c b/libraries/libldif/fetch.c index a9b0cafa95..545253e808 100644 --- a/libraries/libldif/fetch.c +++ b/libraries/libldif/fetch.c @@ -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;