Skip to content

Commit a9ff1c1

Browse files
Update native/src/migration.rs
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent 1869d83 commit a9ff1c1

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

native/src/migration.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,16 @@ pub async fn migrate_keytar_password(service: &str, account: &str) -> Result<boo
3030
)
3131
};
3232

33-
scopeguard::defer! {{
34-
unsafe { CredFree(credential as *mut _) };
35-
}};
36-
3733
if result.is_err() {
3834
// Credential does not exist; nothing to migrate.
3935
return Ok(false);
4036
}
4137

38+
scopeguard::defer! {{
39+
unsafe { CredFree(credential as *mut _) };
40+
}};
41+
}
42+
4243
let blob_bytes: Vec<u8> = unsafe {
4344
let blob_ptr = (*credential).CredentialBlob;
4445
let blob_size = (*credential).CredentialBlobSize as usize;

0 commit comments

Comments
 (0)