av9ash/GitBugs huggingface dataset:
Bug: New tabs in 1 window with MANY open tabs will not open - Using v 126.0.1
Status: RESOLVED
Priority: --
Resolution: INCOMPLETE
Created: 2024-06-04 20:57:27+00:00
Resolved: 2025-02-03 12:31:05+00:00

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0

Steps to reproduce:

Using v 126.0.1 -  I have a LOT of open Firefox Windows with a few of them  having a LOT of open tabs. The one I am using primarily has 141 open tabs, and the problem I am having is when I open a New tab, it takes a while but eventually displays a New tab but when I click in the Search or Address bar of the New tab, it immediately closes the New tab & reverts to my previously active tab.  I can switch to another window & successfully open a new tab.  I have tried closing Firefox & monitoring the closing process in Process Explorer until all instances of FF are closed (which can take a minute or more after all of the Windows Icons on my Task bar have disappeared) ,  before re-starting .


Actual results:

When I open a New tab in this busy Window, it takes a while but eventually displays a New tab but when I click in the Search or Address bar of the New tab, it immediately closes the New tab & reverts to my previously active tab.


Expected results:

It should have opened the New tab in the current Window.
Bug: The "Close" button on new-tab cog sidebar should perhaps overlap where the Cog icon was, so that you can click the same location again to close the sidebar
Status: NEW
Priority: P3
Created: 2024-06-04 21:02:43+00:00
Resolved: 2024-06-24 14:21:57+00:00

STR:
(1) Open a new tab.
(2) Click the center of the cog icon at the top-right, to open the sidebar.
(3) Click the same screen location again.

ACTUAL RESULTS: Nothing happens. Your click barely misses the "Close" button.
EXPECTED RESULTS: Maybe the close button should be shifted rightwards (or the cog button should be shifted leftwards) so that clicking the same location again will close the sidebar?

Intuitively it feels like the close button should be positioned such that a click at the same location will dismiss the dialog, for two reasons:
(a) this is approximately how the cog button works in other bits of our UI where it spawns a popup menu, e.g. in about:addons
(b) the buttons are both top-right-aligned, so it seems like they should use the same "top-right alignment" standard offset; it's not clear why we would have a different top-right-aligned offset for these two cases.
Bug: Brief bright flash of blank/white background color, when opening new tab with wallpaper
Status: NEW
Priority: P3
Created: 2024-06-04 21:38:07+00:00
Resolved: 2024-09-23 22:07:47+00:00

STR:
1. In about:config, set `browser.newtabpage.activity-stream.newtabWallpapers.enabled` to `true`
2. Open a new tab, tap the cog icon, and choose the top-right option (yellow/pink/blue swooshes), or any one that's darker than our default white tab-background.
3. Open a new tab.
4. Open another new tab. (Repeat as-needed.)

ACTUAL RESULTS:
When the new-tab opens, there's a brief flash of the blank page background (which is much brighter than my selected tab wallpaper). This can be a pretty disconcerting flicker, if there's a substantial brightness difference and if you open several new tabs in a row.

EXPECTED RESULTS:
No such flash of the blank new-tab background-color.
Bug: New tab wallpaper briefly renders at wrong size (or position?) and then snaps to correct rendering
Status: NEW
Priority: P3
Created: 2024-06-04 21:40:15+00:00
Resolved: 2024-09-23 22:07:47+00:00

STR (same as bug 1900710):
1. In about:config, set `browser.newtabpage.activity-stream.newtabWallpapers.enabled` to `true`
2. Open a new tab, tap the cog icon, and choose the top-right option (yellow/pink/blue swooshes), or the top center "pink clouds". (Any will do, it's just reasonably easy to see with these ones).
3. Open a new tab.
4. Open another new tab. (Repeat as-needed.)

ACTUAL RESULTS:
When the new-tab opens, there's a brief flash of the wallpaper drawn at the wrong size, before it draws at the correct size. This feels like a weird unexpected "jump".

EXPECTED RESULTS:
No such wrong-size rendering / jump.
Bug: Intermittent browser/components/places/tests/browser/browser_library_bookmark_clear_visits.js | single tracking bug
Status: RESOLVED
Priority: P5
Resolution: FIXED
Created: 2024-06-05 01:02:55+00:00
Resolved: 2024-10-14 19:03:31+00:00

**Filed by:** smolnar [at] mozilla.com
**Parsed log:** https://treeherder.mozilla.org/logviewer?job_id=461095898&repo=autoland
**Full log:** https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/DKVIqbshR3SD5CcCvzzbmg/runs/0/artifacts/public/logs/live_backing.log

---
```
TEST-PASS | browser/components/places/tests/browser/browser_library_bookmark_clear_visits.js | Current view is shown - true == true - 
[task 2024-06-05T00:24:57.630Z] 00:24:57     INFO - Add Most Recent Visit column
[task 2024-06-05T00:24:57.630Z] 00:24:57     INFO - Buffered messages finished
[task 2024-06-05T00:24:57.630Z] 00:24:57     INFO - TEST-UNEXPECTED-FAIL | browser/components/places/tests/browser/browser_library_bookmark_clear_visits.js | Test timed out - 
[task 2024-06-05T00:24:57.631Z] 00:24:57     INFO - GECKO(2841) | Completed ShutdownLeaks collections in process 2841
[task 2024-06-05T00:24:57.631Z] 00:24:57     INFO - TEST-START | Shutdown
```
Bug: Tab preview shows encoded URL when page is in reader mode
Status: VERIFIED
Priority: P2
Resolution: FIXED
Created: 2024-06-05 07:26:25+00:00
Resolved: 2024-07-04 12:18:48+00:00

**Found in**
* 128.0a1 (2024-06-04)

**Affected versions**
* 128.0a1 (2024-06-04)

**Tested platforms**
* Affected platforms: macOS 14.4, Windows 11, Ubuntu 22.04
* Unaffected platforms: none

**Preconditions**
* Have browser.tabs.cardPreview.enabled set to true in about:config 

**Steps to reproduce**
1. Go to any webpage that allows you to open the page in reader mode (e.g. https://www.nytimes.com/2024/06/03/business/electric-cars-becoming-affordable.html) 
2. Press the Toggle reader view icon from the URL bar
3. Hover over the tab so the tab preview is displayed and observe the URL

**Expected result**
* The “nytimes.com” URL is correctly displayed, without showing any encoding parameters

**Actual result**
* The “about:reader?url=https%3A%2F%2Fwww.nytimes..” URL is displayed 

**Regression range*** 
* Last good build: 2024-05-23
* First bad build: 2024-05-24
* Mozregression points to bug 1877838. Before this, no URL was displayed in the tab preview while being in reader mode

**Additional notes**
* See the attached ss
Bug: Intermittent TV browser/components/tabbrowser/test/browser/tabs/browser_tab_preview.js | single tracking bug
Status: RESOLVED
Priority: P5
Resolution: FIXED
Created: 2024-06-05 13:35:35+00:00
Resolved: 2024-06-10 06:50:02+00:00

**Filed by:** sstanca [at] mozilla.com
**Parsed log:** https://treeherder.mozilla.org/logviewer?job_id=461157730&repo=autoland
**Full log:** https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/W9v39ZRuRXKKX1zS3S__Yw/runs/0/artifacts/public/logs/live_backing.log
**Reftest URL:** https://hg.mozilla.org/mozilla-central/raw-file/tip/layout/tools/reftest/reftest-analyzer.xhtml#logurl=https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/W9v39ZRuRXKKX1zS3S__Yw/runs/0/artifacts/public/logs/live_backing.log&only_show_unexpected=1

---
```
[task 2024-06-05T13:08:44.970Z] 13:08:44     INFO - TEST-PASS | browser/components/tabbrowser/test/browser/tabs/browser_tab_preview.js | Preview of tab1 shows correct title - "First New Tab" == "First New Tab" - 
[task 2024-06-05T13:08:44.970Z] 13:08:44     INFO - Buffered messages logged at 13:07:12
[task 2024-06-05T13:08:44.970Z] 13:08:44     INFO - TEST-PASS | browser/components/tabbrowser/test/browser/tabs/browser_tab_preview.js | Preview of tab2 shows correct title - "Second New Tab" == "Second New Tab" - 
[task 2024-06-05T13:08:44.971Z] 13:08:44     INFO - Buffered messages finished
[task 2024-06-05T13:08:44.971Z] 13:08:44     INFO - TEST-UNEXPECTED-FAIL | browser/components/tabbrowser/test/browser/tabs/browser_tab_preview.js | Test timed out - 
[task 2024-06-05T13:08:44.972Z] 13:08:44     INFO - GECKO(1160) | Completed ShutdownLeaks collections in process 1160
[task 2024-06-05T13:08:44.972Z] 13:08:44     INFO - TEST-START | Shutdown
```
Bug: Firefox is freezing if resizing the window during the transition to the blocked dialog for printing operation
Status: VERIFIED
Priority: --
Resolution: FIXED
Created: 2024-06-05 14:13:38+00:00
Resolved: 2024-09-11 11:07:08+00:00

**Found in**
* 128.0a1 (2024-06-05)

**Affected versions**
* 128.0a1 (2024-06-05)

**Tested platforms**
* Affected platforms: Windows 10/11
* Unaffected platforms: macOS, Ubuntu

**Preconditions**
* Download the DLP test assets from https://drive.google.com/file/d/1yjqVRuxdKV3WnO7D2wzMgDXBuYBxUgVw/view
* Create a distribution folder inside the Firefox folder and paste the policies-1.json to it and then rename it to policies.json
* Run the DLP agent in CMD using: .\content_analysis_sdk_agent.exe --user --toblock=.\d{3}-?\d{2}-?\d{4}. --towarn=.warn. --delays=10

**Steps to reproduce**
1. Navigate to https://en.wikipedia.org/wiki/123456789
2. Open the Print Preview (ctrl+P) and press the “Print” button
3. Wait for the OS notification regarding the DLP agent reviewing data to be displayed and then resize the browser during the transition to the “You’re not permitted..” blocked dialog
4. Observe the behavior

**Expected result**
* Firefox is not freezing after resizing the window during the transition to the “You’re not permitted..” blocked dialog

**Actual result**
* Firefox is freezing, causing the entire desktop to become unresponsive

**Regression range*** 
* We suspect that bug 1899714 introduced this issue, but we cannot be sure due to the same bug. This is happening before bug 1898718 as well. 

**Additional notes**
* See the attached video
* The issue is fixed after closing Firefox from Task Manager
* This is only reproducing for the printing operation - and only when resizing the window during the transition to the blocked dialog
* Not reproducing when resizing the window and printing operation is allowed
* Not reproducing for blocked paste / upload operation
Bug: Weather card overlaps with Top Sites button
Status: VERIFIED
Priority: --
Resolution: FIXED
Created: 2024-06-05 16:15:10+00:00
Resolved: 2024-07-22 07:33:49+00:00

The weather card partially covers the top left "Top Sites" button. I thought for a moment that it was some sort of fixed element and that scrolling would move the top sites relative to the weather card, but it does not.

Because the weather card is clickable, it is really easy to click that by accident when attempting to click the button for the overlapped top site. I feel that the weather card being transparent contributes to the confusion for me here.
Bug: Tab Hover Preview: Hide the card when clicking on a tab
Status: RESOLVED
Priority: P2
Resolution: FIXED
Created: 2024-06-05 18:06:10+00:00
Resolved: 2024-07-09 18:54:52+00:00

Nightly 128.0a1 (2024-06-05) (64-Bit)

1.) Hover over a tab, so that the hover card preview appears.
2.) Click on the tab.

Actual: The Hover card preview is still to see.
Expected: The Hover card preview should disappear.

Still showing the Hover card preview when selecting the tab is distracting. Please compare with other browsers like Chrome or Safari. There it disappears when clicking/selecting the tab.
Bug: Perma documentation ./mach doc | /builds/worker/checkouts/gecko/BackupService.sys.mjs:./browser/components/backup/BackupService.sys.BackupService(58):114: WARNING: 'any' reference target not found: BackupService.loadEncryptionState();
Status: RESOLVED
Priority: P5
Resolution: FIXED
Created: 2024-06-05 19:17:31+00:00
Resolved: 2024-06-10 06:26:51+00:00

**Filed by:** nfay [at] mozilla.com
**Parsed log:** https://treeherder.mozilla.org/logviewer?job_id=461203520&repo=autoland
**Full log:** https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/Isz1WCceQ0apXo4S1tHF9g/runs/0/artifacts/public/logs/live_backing.log

---
```
[task 2024-06-05T19:13:43.928Z] ages... [100%] widget/windows/windows-pointing-device/touch_media_queries.png
[task 2024-06-05T19:13:44.892Z] dumping search index in English (code: en)... done
[task 2024-06-05T19:13:45.001Z] dumping object inventory... done
[task 2024-06-05T19:13:45.002Z] build succeeded, 893 warnings.
[task 2024-06-05T19:13:45.002Z] 
[task 2024-06-05T19:13:45.002Z] The HTML pages are in docs-out/html.
[task 2024-06-05T19:13:45.020Z] TEST-UNEXPECTED-FAILURE | ./mach doc | Error: Got fatal warnings:
[task 2024-06-05T19:13:45.020Z] TEST-UNEXPECTED-FAILURE | ./mach doc | /builds/worker/checkouts/gecko/BackupService.sys.mjs:./browser/components/backup/BackupService.sys.BackupService(58):114: WARNING: 'any' reference target not found: BackupService.loadEncryptionState();
[task 2024-06-05T19:13:45.020Z] TEST-UNEXPECTED-FAILURE | ./mach doc | 
[task 2024-06-05T19:13:45.027Z] 
[task 2024-06-05T19:13:45.027Z] Generated documentation:
[task 2024-06-05T19:13:45.027Z] docs-out/html
[task 2024-06-05T19:13:45.027Z] Logged 843 warnings
[task 2024-06-05T19:13:45.027Z] 
[taskcluster 2024-06-05 19:13:55.232Z] === Task Finished ===
[taskcluster 2024-06-05 19:13:55.250Z] Artifact "public/trees.json" not found at "/builds/worker/artifacts/trees.json": (HTTP code 404) no such container - Could not find the file /builds/worker/artifacts/trees.json in container 5d590e3f9554574f733db13875111d9636fb7e6d2a52c0510bc41c72e88a30fa 
[taskcluster 2024-06-05 19:13:55.252Z] Artifact "public/docs.tar.gz" not found at "/builds/worker/checkouts/gecko/docs-out/main.tar.gz": (HTTP code 404) no such container - Could not find the file /builds/worker/checkouts/gecko/docs-out/main.tar.gz in container 5d590e3f9554574f733db13875111d9636fb7e6d2a52c0510bc41c72e88a30fa 
[taskcluster 2024-06-05 19:13:55.330Z] Unsuccessful task run with exit code: 1 completed in 406.221 seconds
```
Bug: High Freq browser/components/tabbrowser/test/browser/tabs/browser_tabContextMenu_keyboard.js | single tracking bug
Status: RESOLVED
Priority: P5
Resolution: INCOMPLETE
Created: 2024-06-05 20:00:46+00:00
Resolved: 2024-12-09 12:06:08+00:00

**Filed by:** nfay [at] mozilla.com
**Parsed log:** https://treeherder.mozilla.org/logviewer?job_id=461179688&repo=autoland
**Full log:** https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/B-IYvYTPSTK7oKDC1cRhnA/runs/0/artifacts/public/logs/live_backing.log

---
```
[task 2024-06-05T16:35:48.233Z] 16:35:48     INFO - TEST-START | browser/components/tabbrowser/test/browser/tabs/browser_tabContextMenu_keyboard.js
[task 2024-06-05T16:36:33.241Z] 16:36:33     INFO - TEST-INFO | started process screentopng
[task 2024-06-05T16:36:33.420Z] 16:36:33     INFO - TEST-INFO | screentopng: exit 0
[task 2024-06-05T16:36:33.420Z] 16:36:33     INFO - Buffered messages logged at 16:35:48
[task 2024-06-05T16:36:33.420Z] 16:36:33     INFO - Entering test bound test
[task 2024-06-05T16:36:33.421Z] 16:36:33     INFO - TEST-PASS | browser/components/tabbrowser/test/browser/tabs/browser_tabContextMenu_keyboard.js | tab1 should be focused - 
[task 2024-06-05T16:36:33.422Z] 16:36:33     INFO - Buffered messages finished
[task 2024-06-05T16:36:33.423Z] 16:36:33     INFO - TEST-UNEXPECTED-FAIL | browser/components/tabbrowser/test/browser/tabs/browser_tabContextMenu_keyboard.js | Test timed out - 
[task 2024-06-05T16:36:33.423Z] 16:36:33     INFO - GECKO(24901) | Completed ShutdownLeaks collections in process 24901
[task 2024-06-05T16:36:33.424Z] 16:36:33     INFO - TEST-START | Shutdown
[task 2024-06-05T16:36:33.424Z] 16:36:33     INFO - Browser Chrome Test Summary
[task 2024-06-05T16:36:33.425Z] 16:36:33     INFO - Passed:  2960
[task 2024-06-05T16:36:33.425Z] 16:36:33     INFO - Failed:  1
[task 2024-06-05T16:36:33.426Z] 16:36:33     INFO - Todo:    0
[task 2024-06-05T16:36:33.427Z] 16:36:33     INFO - Mode:    e10s
[task 2024-06-05T16:36:33.427Z] 16:36:33     INFO - *** End BrowserChrome Test Results ***
```
Bug: When Typing Urls, Autocomplete puts the 1st Suggestion in the Address Bar, Not in the List of Suggestions
Status: REOPENED
Priority: P5
Created: 2024-06-06 03:31:57+00:00
Resolved: 2024-07-16 04:22:07+00:00

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:126.0) Gecko/20100101 Firefox/126.0



Actual results:

If I *do* want to go to the 1st suggestion, it's jarring to start typing, arrow down to the suggestion list, hit enter, look up, ... and find another site, because the 2nd suggestion is 1st on the list.

Not everyone can watch the keyboard with one eye and the screen with another at the same time.

If I don't want to, it's jarring to type the full url, hit enter, look up, and find another site, because the 1st suggestion overrides the actual typed url.

There are a number of similar bugs concerning pasted urls, which seem to be fixed, but the bug persists with typed urls.


Expected results:

The actual typed url should remain.

The 1st suggestion should appear in the list of suggestions, instead of the address bar.

This does require an extra arrow key for people who want a suggested result, but it spares a lot of trouble for people who don't want one, or who expect the 1st suggestion to appear in the list of suggestions.
Bug: We're deduping adaptive history results in the urlbar that come before remote tabs from other devices, pushing the results down in the list.
Status: NEW
Priority: P3
Created: 2024-06-06 03:50:39+00:00
Resolved: 2025-01-27 16:42:55+00:00

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0

Steps to reproduce:

I have some very frequently used history urls that I type certain strings to bring up in the urlbar quickly and reliably, but when they are also opened on my other synced devices, they are de-prioritized and needs to manually look for and press tab several times.

* type "wl" in urlbar to get very frequently used url `https://www.youtube.com/playlist?list=WL`


Actual results:

If the same url is opened in any of my other synced devices, it is no longer the first result.


Expected results:

A url opened on another device shouldn't be de-prioritized. Frequently used urls should complete reliably regardless of state on another device.

I can't understand why it is so. That a url is opened on another device doesn't mean I don't need to visit it on this device --- on the contrast it may mean I want to visit it more likely since it isn't closed yet.

Taken into account that I don't usually remember what was opened elsewhere, and I don't plan where each url is going to be opened in advance, it might be a good idea to not take "opened on another device" into account when sorting completion results.
Bug: Always open similar files cannot longer be unchecked if the file was manually deleted while the option was active
Status: NEW
Priority: P3
Created: 2024-06-06 05:37:20+00:00
Resolved: 2024-06-07 12:22:11+00:00

**Found in**
- Firefox 128.0a1

**Affected versions**
- Firefox 127.0
- Firefox 128.0a1

**Tested platforms**
- Affected platforms: Windows 11, Ubuntu 22.04, macOS 14.5

**Steps to reproduce**
1. Download any file of choice, for example the [.zip file](https://ftp.mozilla.org/pub/firefox/releases/0.9rc/) from archive
2. After the download is finished, right click on the file in downloads panel and select "Always open similar files"
3. Go to the location where the file was downloaded and delete it
4. Right click on downloads panel on the download and select again "Always open similar files"

**Expected result**
- The option is unchecked

**Actual result**
- The option can no longer be unchecked

**Regression range**
- Will see for a regression

**Additional notes**
- The issue can be seen in the following [attachment](https://drive.google.com/file/d/1rVs9Uwqzf3Lj4NjfNp7KlMrzQV4GQqSa/view?usp=sharing)
Bug: [rustc 1.80] Perma error: struct `MockCommand` is never constructed
Status: RESOLVED
Priority: P5
Resolution: FIXED
Created: 2024-06-06 06:37:18+00:00
Resolved: 2024-06-12 04:56:07+00:00

**Filed by:** mh [at] glandium.org
**Parsed log:** https://treeherder.mozilla.org/logviewer?job_id=461243743&repo=toolchains
**Full log:** https://firefox-ci-tc.services.mozilla.com/api/queue/v1/task/RbS0azQgQCuCBhGqHonXEQ/runs/0/artifacts/public/logs/live_backing.log

---
```
[task 2024-06-06T01:47:44.819Z] 01:47:44    ERROR -  error: struct `MockCommand` is never constructed
[task 2024-06-06T01:47:44.819Z] 01:47:44     INFO -     --> browser/app/nmhproxy/src/commands.rs:101:8
[task 2024-06-06T01:47:44.819Z] 01:47:44     INFO -      |
[task 2024-06-06T01:47:44.819Z] 01:47:44     INFO -  101 | struct MockCommand {
[task 2024-06-06T01:47:44.819Z] 01:47:44     INFO -      |        ^^^^^^^^^^^
[task 2024-06-06T01:47:44.819Z] 01:47:44     INFO -      |
[task 2024-06-06T01:47:44.819Z] 01:47:44     INFO -      = note: `-D dead-code` implied by `-D warnings`
[task 2024-06-06T01:47:44.820Z] 01:47:44     INFO -      = help: to override `-D warnings` add `#[allow(dead_code)]`
[task 2024-06-06T01:47:44.820Z] 01:47:44    ERROR -  error: could not compile `nmhproxy` (bin "nmhproxy") due to 1 previous error
```
Bug: [meta] Crash in [@ RtlpFreeHeapInternal | RtlFreeHeap | APP_DATA::FreeCachedMem] - Heap corruption after double-freeing a BSTR
Status: RESOLVED
Priority: --
Resolution: WORKSFORME
Created: 2024-06-06 08:53:02+00:00
Resolved: 2024-12-18 00:40:31+00:00

The attached crash signature groups together various issues. The issues can be separated through aggregation on proto signatures. The most recurring way to end up in this crash signature (and the only way so far I believe) is that some code frees the same BSTR twice. We have seen this mistake occur in third-party DLLs (e.g. bug 1692908, bug 1900796) but also in Microsoft DLLs (e.g. bug 1675760 comment 11).

One reason for these bugs is that `VariantClear` on a `VT_BSTR` will free the string and sometimes people forget that. Another reason is that `VariantClear` only clears `vt` but it will not clear `bstrVal`.

Here are examples of what the faulty codes can look like:

```c++
BSTR bstr = SysAllocString(L"foo");

// ...

VARIANT var;
VariantInit(&var);

var.vt = VT_BSTR;
var.bstrVal = bstr;
// This is not a copy. This should be considered a transfer of ownership of the string from bstr to var.
// To do a copy here, use: var.bstrVal = SysAllocString(bstr);

// ...

VariantClear(&var);
SysFreeString(bstr); // Wrong, the string has already been freed
```

```c++
VARIANT var1;
VariantInit(&var1);

var1.vt = VT_BSTR;
var1.bstrVal = SysAllocString(L"foo");

// ...

VARIANT var2;
VariantInit(&var2);

var2.vt = VT_BSTR;
var2.bstrVal = var1.bstrVal;
// This is not a copy. This should be considered a transfer of ownership of the string from var1 to var2.
// To do a copy here, use: var2.bstrVal = SysAllocString(var1.bstrVal);

// ...

VariantClear(&var1); // Wrong, var2 now owns the string. var1 should not be cleared.
VariantClear(&var2); // This will free the string twice.
```

```c++
VARIANTARG var;
VariantInit(&var);

var.vt = VT_BSTR;
var.bstrVal = SysAllocString(L"foo");
VariantClear(&var);

// This intends to reuse var.
var.vt = VT_BSTR;
if (/* some condition */) {
    var.bstrVal = SysAllocString(L"bar");
    // ...
}
VariantClear(&var); // Wrong, VariantClear hasn't cleared bstrVal.
// If we don't enter the condition, the string will be freed twice.
```