diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index 0d289e6d878b6f1b9db271c1e7df7f9108dcadf2..cca65f2ce1f3445a21da55d94b61209b6fc7741c 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -1215,6 +1215,7 @@ void LLOutfitGallery::uploadPhoto(LLUUID outfit_id)
                 upload_pending_name, callback, expected_upload_cost, nruserdata);
             mOutfitLinkPending = outfit_id;
         }
+        delete unit;
     }
 }