client: Fix two memory leaks in handle_job_opt()
Do not leak p if pdu->global != 0.
This is an improvement for a previous attempt to fix handle_job_opt(). See
also commit
ebae36a28aee ("client: Fix memory leaks in handle_job_opt()").
Do not leak strdup(pdu->name) when calling json_object_add_value_string().
That function namely (indirectly) duplicates its 'name' argument.
This patch fixes the following Coverity complaint:
CID 169311 (#1 of 1): Resource leak (RESOURCE_LEAK)
9. leaked_storage: Variable p going out of scope leaks the storage it points to.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>