Do not allocate buffer data when size is zero
Merge pull request #11 from pmed/shared_buffer-fix

Do not allocate buffer data when size is zero