[Issue 10309] Handle potential null pointers returned by ber_strdup