If it fails, it means that the client is in use and so destroying it
would be bad. Currently, the client_mutex prevents this from happening
but once we remove it, we won't be able to do this.
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
                old = find_confirmed_client_by_name(&unconf->cl_name, nn);
                if (old) {
                        status = mark_client_expired_locked(old);
-                       if (status)
+                       if (status) {
+                               old = NULL;
                                goto out_free_conn;
+                       }
                }
                move_to_confirmed(unconf);
                conf = unconf;
                old = find_confirmed_client_by_name(&unconf->cl_name, nn);
                if (old) {
                        status = mark_client_expired_locked(old);
-                       if (status)
+                       if (status) {
+                               old = NULL;
                                goto out;
+                       }
                }
                move_to_confirmed(unconf);
                conf = unconf;