From 01be63c587ca96d26dd3e2670d08b82bd8b882c2 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 10 Dec 2025 00:13:40 -0500 Subject: [PATCH] Add missing instances of cleanupOnFail() in synccycles.DeviceIDGen() --- synccycles/init.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/synccycles/init.go b/synccycles/init.go index 44524e4..5bc1ccf 100644 --- a/synccycles/init.go +++ b/synccycles/init.go @@ -67,6 +67,7 @@ func DeviceIDGen(oldDeviceID, prefix string) (string, string, string, error) { return "", "", "", errors.New("unable to unmarshal server register response: " + err.Error()) } if registerResp.ErrMsg != nil { + cleanupOnFail() return "", "", "", errors.New("unable to complete register; server-side error occurred: " + *registerResp.ErrMsg) } _ = sshClient.Close() // ignore error; non-critical/unlikely/not much could be done about it @@ -74,6 +75,7 @@ func DeviceIDGen(oldDeviceID, prefix string) (string, string, string, error) { // remove old device ID file (locally; may not exist) err = os.RemoveAll(oldDeviceIDPath) if err != nil { + cleanupOnFail() return "", "", "", errors.New("unable to remove old device ID file (locally): " + err.Error()) }