CPT ends August 26th, H1 on October 1st.

My CPT ends on August 26th and i am done with all the courses required to complete my masters. and my H1 got approved. Can I legally be in the US until October 1st(Unpaid leave from company) or do I need to register for CPT again.