Setting the initial pointer to NULL doesn't do anything as it gets set by the subsequent function. As was pointed out if NULL is not set, then on error freecon tries to free uninitialised memory.
Logging the error seem ok.I removed these from the submitted patch although I notice other JNI code uses strerror to clarify problems. Maybe some other time !! What exception is the app aborting with? The getPeerContext that I was testing aborted with invalid address. The most important one though was the ALOGV entry as that cause Zygote to abort when it called getPeerContext. On Tue, May 21, 2013 at 12:20 PM, Richard Haines <[email protected]> wrote: I've been attempting to test some networking and had problems with SELinux.getPeerContext when no context set using java.net.Socket - the app aborts. This patch fixes the two problems in getPeerCon. I've also patched the other get... methods/functions to set the initial pointer to null and give the error. Does this seem reasonable. Richard -- Respectfully, William C Roberts
