Skip to content

Commit 2eedfb6

Browse files
committed
internal/ctlog: don't add pending leaves to closed pools
Claude Code noticed the potential memory leak.
1 parent 8c07aa5 commit 2eedfb6

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/ctlog/ctlog.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,11 @@ func (l *Log) addLeafToPool(ctx context.Context, leaf *PendingLogEntry) (f waitE
633633
l.poolMu.Lock()
634634
defer l.poolMu.Unlock()
635635
p := l.currentPool
636+
if err := p.err; err != nil {
637+
return func(ctx context.Context) (*sunlight.LogEntry, error) {
638+
return nil, err
639+
}, "closed"
640+
}
636641
h := computeCacheHash(leaf.Certificate, leaf.IsPrecert, leaf.IssuerKeyHash)
637642
if f, ok := p.byHash[h]; ok {
638643
return f, "pool"

0 commit comments

Comments
 (0)