> 1. hdfs.c - In hdfsConnectAsUserNewInstance90 method jAttrString is not released before subsequent returns. Is this fine?
You are entirely correct that it should be released, similar to jAttrString in hdfsConnectAsUser
> 2. hdfs.c - In hdfsOpenFile(), jpath, jStrBufferSize, jStrReplication, jStrBlockSize is not release before subsequent return (if (!file) check)
The original author must have thought that if you cannot malloc a few bytes you are hosed anyhow.
> 3. hdfs.c - In hdfsGetHosts() does blockHosts leak in subsequent return NULL?
It is the responsibility of the client to call hdfsFreeHosts, similar to calling hdfsFreeFileInfo after a call to hdfsGetPathInfo.
> On a side note, the code seems to be prone to introducing leaks. Seems to me we should have some kind of stack variable that tracks the objects to be deleted and cleans them up when it goes out of scope.
One giant step forward would be to replace the libhfds library (which uses JNI) with a socket interface allowing C++ to directly access hdfs servers (would increase performance and reduce memory footprint)