Don't modify pointer inside processing method but work on a local copy of it

Changing a pointer given as input parameter of a method and changing it is rather bad
style. It's more appropiate to make a local copy of the pointer inside the processing
method and work on this one and leave the outside one in it's original state.

This improves readability of the code a lot.

Open-webOS-DCO-1.0-Signed-off-by: Simon Busch <morphis@gravedo.de>