sgsn/test: Make assert_substr safer (Coverity)

Currently, if assert_subscr were called with subscr == NULL, the
later call to subscr_put might fail, as Coverity has complained. In
addition, the call to subscr_put would free the subscr object if it
were in the cache with a refcount of 0 at the time assert_substr was
called.

This patch adds a check for the subscr being non-NULL and reorders
the checks, so that the subscr_put comes last.

Fixes: Coverity CID 1264590

Sponsored-by: On-Waves ehf
1 file changed
tree: 710143e6d88f58c2711781f9c83e588e80d919c3
  1. debian/
  2. hlrsync/
  3. linux-kernel/
  4. openbsc/
  5. wireshark/
  6. README